weed mount, weed dav add option to force cache

This commit is contained in:
chrislu
2024-09-04 01:19:14 -07:00
parent 66ac82bb8f
commit 7367b976b0
9 changed files with 22 additions and 9 deletions

View File

@@ -41,6 +41,7 @@ type Option struct {
CacheDirForRead string
CacheSizeMBForRead int64
CacheDirForWrite string
ForceCache bool
DataCenter string
Umask os.FileMode
Quota int64
@@ -95,7 +96,7 @@ func NewSeaweedFileSystem(option *Option) *WFS {
wfs.option.filerIndex = int32(rand.Intn(len(option.FilerAddresses)))
wfs.option.setupUniqueCacheDirectory()
if option.CacheSizeMBForRead > 0 {
wfs.chunkCache = chunk_cache.NewTieredChunkCache(256, option.getUniqueCacheDirForRead(), option.CacheSizeMBForRead, 1024*1024)
wfs.chunkCache = chunk_cache.NewTieredChunkCache(256, option.getUniqueCacheDirForRead(), option.CacheSizeMBForRead, 1024*1024, option.ForceCache)
}
wfs.metaCache = meta_cache.NewMetaCache(path.Join(option.getUniqueCacheDirForRead(), "meta"), option.UidGidMapper,