aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys/wfs.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-04-21 21:16:13 -0700
committerChris Lu <chris.lu@gmail.com>2020-04-21 21:16:13 -0700
commite24b25de784daf42a15daf573249d608ebc2b44a (patch)
tree53418a50125f664565572aea8e7fa10950c90a12 /weed/filesys/wfs.go
parent4f02f7121d232507bbbba825fa241bc8d5e630ff (diff)
downloadseaweedfs-e24b25de784daf42a15daf573249d608ebc2b44a.tar.xz
seaweedfs-e24b25de784daf42a15daf573249d608ebc2b44a.zip
async meta caching: can stream updates now
Diffstat (limited to 'weed/filesys/wfs.go')
-rw-r--r--weed/filesys/wfs.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/weed/filesys/wfs.go b/weed/filesys/wfs.go
index b27ac440d..e67e77613 100644
--- a/weed/filesys/wfs.go
+++ b/weed/filesys/wfs.go
@@ -95,6 +95,14 @@ func NewSeaweedFileSystem(option *Option) *WFS {
}
if wfs.option.AsyncMetaDataCaching {
wfs.metaCache = meta_cache.NewMetaCache(path.Join(option.CacheDir, "meta"))
+ if err := meta_cache.InitMetaCache(wfs.metaCache, wfs); err != nil{
+ glog.V(0).Infof("failed to init meta cache: %v", err)
+ } else {
+ go meta_cache.SubscribeMetaEvents(wfs.metaCache, wfs, wfs.option.FilerMountRootPath)
+ util.OnInterrupt(func() {
+ wfs.metaCache.Shutdown()
+ })
+ }
}
wfs.root = &Dir{name: wfs.option.FilerMountRootPath, wfs: wfs}