mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-12-17 17:51:20 +08:00
async meta caching: can stream updates now
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user