Add option to reset the registry

This commit is contained in:
Daniel 2020-11-24 16:11:03 +01:00
parent 30e2f19b94
commit eb17a5e6b8

View file

@ -171,6 +171,14 @@ func (reg *ResourceRegistry) Purge(keep int) {
}
}
// Reset resets the internal state of the registry, removing all added resources.
func (reg *ResourceRegistry) Reset() {
reg.Lock()
defer reg.Unlock()
reg.resources = make(map[string]*Resource)
}
// Cleanup removes temporary files.
func (reg *ResourceRegistry) Cleanup() error {
// delete download tmp dir