mirror of
https://github.com/clearlinux/libnetwork.git
synced 2026-05-13 18:13:35 +00:00
Merge pull request #225 from mrjana/docker1.7.0_integ
Rework garbage collection code to use tick
This commit is contained in:
@@ -55,9 +55,7 @@ func createBasePath() {
|
||||
}
|
||||
|
||||
func removeUnusedPaths() {
|
||||
for {
|
||||
time.Sleep(time.Duration(gpmCleanupPeriod))
|
||||
|
||||
for range time.Tick(gpmCleanupPeriod) {
|
||||
gpmLock.Lock()
|
||||
pathList := make([]string, 0, len(garbagePathMap))
|
||||
for path := range garbagePathMap {
|
||||
@@ -78,13 +76,13 @@ func removeUnusedPaths() {
|
||||
func addToGarbagePaths(path string) {
|
||||
gpmLock.Lock()
|
||||
garbagePathMap[path] = true
|
||||
defer gpmLock.Unlock()
|
||||
gpmLock.Unlock()
|
||||
}
|
||||
|
||||
func removeFromGarbagePaths(path string) {
|
||||
gpmLock.Lock()
|
||||
delete(garbagePathMap, path)
|
||||
defer gpmLock.Unlock()
|
||||
gpmLock.Unlock()
|
||||
}
|
||||
|
||||
// GenerateKey generates a sandbox key based on the passed
|
||||
|
||||
Reference in New Issue
Block a user