aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys/wfs.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-06-06 20:22:42 -0700
committerChris Lu <chris.lu@gmail.com>2021-06-06 20:22:42 -0700
commite00443a940db81b195575309b9ff9128678de896 (patch)
treee34eef74061dc9ee237c20561042d3660114e55c /weed/filesys/wfs.go
parent44f1ba68944ed9ff79324317902e1a768d7e92bb (diff)
downloadseaweedfs-e00443a940db81b195575309b9ff9128678de896.tar.xz
seaweedfs-e00443a940db81b195575309b9ff9128678de896.zip
mount: adjust starting order
avoid possible nil wfs.Server
Diffstat (limited to 'weed/filesys/wfs.go')
-rw-r--r--weed/filesys/wfs.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/weed/filesys/wfs.go b/weed/filesys/wfs.go
index 178e4e497..0e0050964 100644
--- a/weed/filesys/wfs.go
+++ b/weed/filesys/wfs.go
@@ -125,8 +125,6 @@ func NewSeaweedFileSystem(option *Option) *WFS {
glog.V(4).Infof("InvalidateEntry %s : %v", filePath, err)
}
})
- startTime := time.Now()
- go meta_cache.SubscribeMetaEvents(wfs.metaCache, wfs.signature, wfs, wfs.option.FilerMountRootPath, startTime.UnixNano())
grace.OnInterrupt(func() {
wfs.metaCache.Shutdown()
})
@@ -141,6 +139,11 @@ func NewSeaweedFileSystem(option *Option) *WFS {
return wfs
}
+func (wfs *WFS) StartBackgroundTasks() {
+ startTime := time.Now()
+ go meta_cache.SubscribeMetaEvents(wfs.metaCache, wfs.signature, wfs, wfs.option.FilerMountRootPath, startTime.UnixNano())
+}
+
func (wfs *WFS) Root() (fs.Node, error) {
return wfs.root, nil
}