Commit a4af95ae authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Drop RecurringPurge.

It had a race condition. Removing it frees us from having go-routines
hanging around after the FS is unmounted.
parent 83dd60a5
...@@ -96,16 +96,6 @@ func (c *TimedCache) Purge() { ...@@ -96,16 +96,6 @@ func (c *TimedCache) Purge() {
} }
} }
func (c *TimedCache) RecurringPurge() {
if c.ttl <= 0 {
return
}
c.Purge()
c.PurgeTimer = time.AfterFunc(c.ttl*5,
func() { c.RecurringPurge() })
}
func (c *TimedCache) DropAll(names []string) { func (c *TimedCache) DropAll(names []string) {
c.cacheMapMutex.Lock() c.cacheMapMutex.Lock()
defer c.cacheMapMutex.Unlock() defer c.cacheMapMutex.Unlock()
......
...@@ -100,7 +100,6 @@ func NewUnionFs(fileSystems []fuse.FileSystem, options UnionFsOptions) *UnionFs ...@@ -100,7 +100,6 @@ func NewUnionFs(fileSystems []fuse.FileSystem, options UnionFsOptions) *UnionFs
g.branchCache = NewTimedCache( g.branchCache = NewTimedCache(
func(n string) (interface{}, bool) { return g.getBranchAttrNoCache(n), true }, func(n string) (interface{}, bool) { return g.getBranchAttrNoCache(n), true },
options.BranchCacheTTL) options.BranchCacheTTL)
g.branchCache.RecurringPurge()
g.hiddenFiles = make(map[string]bool) g.hiddenFiles = make(map[string]bool)
for _, name := range options.HiddenFiles { for _, name := range options.HiddenFiles {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment