diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-07-11 06:16:17 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-07-11 06:16:17 -0700 |
| commit | e3e00d36c51c7b1ff83f71c0eb00f705b7ba2028 (patch) | |
| tree | dc247aa13ead36db2475a43b1a482dc20e55465a | |
| parent | 7ad0bce2f5d9a7adc46165c00163e48705ef2d47 (diff) | |
| download | seaweedfs-e3e00d36c51c7b1ff83f71c0eb00f705b7ba2028.tar.xz seaweedfs-e3e00d36c51c7b1ff83f71c0eb00f705b7ba2028.zip | |
reset cache for each new release
| -rw-r--r-- | weed/filesys/wfs.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/weed/filesys/wfs.go b/weed/filesys/wfs.go index 9f7936f00..1bd36167b 100644 --- a/weed/filesys/wfs.go +++ b/weed/filesys/wfs.go @@ -53,7 +53,7 @@ var _ = fs.FS(&WFS{}) var _ = fs.FSStatfser(&WFS{}) type WFS struct { - option *Option + option *Option // contains all open handles, protected by handlesLock handlesLock sync.Mutex @@ -76,15 +76,15 @@ type statsCache struct { func NewSeaweedFileSystem(option *Option) *WFS { wfs := &WFS{ - option: option, - handles: make(map[uint64]*FileHandle), + option: option, + handles: make(map[uint64]*FileHandle), bufPool: sync.Pool{ New: func() interface{} { return make([]byte, option.ChunkSizeLimit) }, }, } - cacheUniqueId := util.Md5([]byte(option.FilerGrpcAddress))[0:4] + cacheUniqueId := util.Md5([]byte(option.FilerGrpcAddress + option.FilerMountRootPath + util.Version()))[0:4] cacheDir := path.Join(option.CacheDir, cacheUniqueId) if option.CacheSizeMB > 0 { os.MkdirAll(cacheDir, 0755) |
