|
@@ -56,9 +56,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 {
|
|
@@ -79,13 +77,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
|