mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-06 22:18:28 +00:00
Add ability to Flush CollectionFactory. #116
This commit is contained in:
@@ -80,3 +80,15 @@ func (factory *CollectionFactory) PublishedRepoCollection() *PublishedRepoCollec
|
||||
|
||||
return factory.publishedRepos
|
||||
}
|
||||
|
||||
// Flush removes all references to collections, so that memory could be reclaimed
|
||||
func (factory *CollectionFactory) Flush() {
|
||||
factory.Lock()
|
||||
defer factory.Unlock()
|
||||
|
||||
factory.localRepos = nil
|
||||
factory.snapshots = nil
|
||||
factory.remoteRepos = nil
|
||||
factory.publishedRepos = nil
|
||||
factory.packages = nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user