mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
reset cache for each new release
This commit is contained in:
parent
7ad0bce2f5
commit
e3e00d36c5
|
@ -53,7 +53,7 @@ var _ = fs.FS(&WFS{})
|
||||||
var _ = fs.FSStatfser(&WFS{})
|
var _ = fs.FSStatfser(&WFS{})
|
||||||
|
|
||||||
type WFS struct {
|
type WFS struct {
|
||||||
option *Option
|
option *Option
|
||||||
|
|
||||||
// contains all open handles, protected by handlesLock
|
// contains all open handles, protected by handlesLock
|
||||||
handlesLock sync.Mutex
|
handlesLock sync.Mutex
|
||||||
|
@ -76,15 +76,15 @@ type statsCache struct {
|
||||||
|
|
||||||
func NewSeaweedFileSystem(option *Option) *WFS {
|
func NewSeaweedFileSystem(option *Option) *WFS {
|
||||||
wfs := &WFS{
|
wfs := &WFS{
|
||||||
option: option,
|
option: option,
|
||||||
handles: make(map[uint64]*FileHandle),
|
handles: make(map[uint64]*FileHandle),
|
||||||
bufPool: sync.Pool{
|
bufPool: sync.Pool{
|
||||||
New: func() interface{} {
|
New: func() interface{} {
|
||||||
return make([]byte, option.ChunkSizeLimit)
|
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)
|
cacheDir := path.Join(option.CacheDir, cacheUniqueId)
|
||||||
if option.CacheSizeMB > 0 {
|
if option.CacheSizeMB > 0 {
|
||||||
os.MkdirAll(cacheDir, 0755)
|
os.MkdirAll(cacheDir, 0755)
|
||||||
|
|
Loading…
Reference in a new issue