mirror of
https://github.com/safing/portbase
synced 2025-09-01 18:19:57 +00:00
Add option to reset the registry
This commit is contained in:
parent
30e2f19b94
commit
eb17a5e6b8
1 changed files with 8 additions and 0 deletions
|
@ -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.
|
// Cleanup removes temporary files.
|
||||||
func (reg *ResourceRegistry) Cleanup() error {
|
func (reg *ResourceRegistry) Cleanup() error {
|
||||||
// delete download tmp dir
|
// delete download tmp dir
|
||||||
|
|
Loading…
Add table
Reference in a new issue