mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-07 22:20:24 +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
|
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