aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys/wfs.go
diff options
context:
space:
mode:
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}