diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-06-28 10:18:32 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-06-28 10:18:32 -0700 |
| commit | 9033a7d3692572fc10ddf47d992a91271d693f52 (patch) | |
| tree | e65106c911a50face36dde37d6c694571e1952f4 /weed/filesys/wfs.go | |
| parent | 1bb8cae65d499dc48cc2d7db2dc5692482f3f305 (diff) | |
| download | seaweedfs-9033a7d3692572fc10ddf47d992a91271d693f52.tar.xz seaweedfs-9033a7d3692572fc10ddf47d992a91271d693f52.zip | |
removed async option
Diffstat (limited to 'weed/filesys/wfs.go')
| -rw-r--r-- | weed/filesys/wfs.go | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/weed/filesys/wfs.go b/weed/filesys/wfs.go index 2b0ef64c2..7fbab271c 100644 --- a/weed/filesys/wfs.go +++ b/weed/filesys/wfs.go @@ -10,18 +10,20 @@ import ( "sync" "time" - "github.com/chrislusf/seaweedfs/weed/util/grace" "github.com/karlseguin/ccache" "google.golang.org/grpc" + "github.com/chrislusf/seaweedfs/weed/util/grace" + + "github.com/seaweedfs/fuse" + "github.com/seaweedfs/fuse/fs" + "github.com/chrislusf/seaweedfs/weed/filesys/meta_cache" "github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/pb" "github.com/chrislusf/seaweedfs/weed/pb/filer_pb" "github.com/chrislusf/seaweedfs/weed/util" "github.com/chrislusf/seaweedfs/weed/util/chunk_cache" - "github.com/seaweedfs/fuse" - "github.com/seaweedfs/fuse/fs" ) type Option struct { @@ -47,7 +49,6 @@ type Option struct { OutsideContainerClusterMode bool // whether the mount runs outside SeaweedFS containers Cipher bool // whether encrypt data on volume server - AsyncMetaDataCaching bool // whether asynchronously cache meta data } @@ -95,17 +96,16 @@ func NewSeaweedFileSystem(option *Option) *WFS { wfs.chunkCache.Shutdown() }) } - if wfs.option.AsyncMetaDataCaching { - wfs.metaCache = meta_cache.NewMetaCache(path.Join(option.CacheDir, "meta")) - startTime := time.Now() - if err := meta_cache.InitMetaCache(wfs.metaCache, wfs, wfs.option.FilerMountRootPath); err != nil { - glog.V(0).Infof("failed to init meta cache: %v", err) - } else { - go meta_cache.SubscribeMetaEvents(wfs.metaCache, wfs, wfs.option.FilerMountRootPath, startTime.UnixNano()) - grace.OnInterrupt(func() { - wfs.metaCache.Shutdown() - }) - } + + wfs.metaCache = meta_cache.NewMetaCache(path.Join(option.CacheDir, "meta")) + startTime := time.Now() + if err := meta_cache.InitMetaCache(wfs.metaCache, wfs, wfs.option.FilerMountRootPath); err != nil { + glog.V(0).Infof("failed to init meta cache: %v", err) + } else { + go meta_cache.SubscribeMetaEvents(wfs.metaCache, wfs, wfs.option.FilerMountRootPath, startTime.UnixNano()) + grace.OnInterrupt(func() { + wfs.metaCache.Shutdown() + }) } wfs.root = &Dir{name: wfs.option.FilerMountRootPath, wfs: wfs} |
