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

@@ -38,6 +38,7 @@ type WebDavOption struct {
Cipher bool
CacheDir string
CacheSizeMB int64
ForceCache bool
MaxMB int
}
@@ -133,7 +134,7 @@ func NewWebDavFileSystem(option *WebDavOption) (webdav.FileSystem, error) {
cacheDir := path.Join(option.CacheDir, cacheUniqueId)
os.MkdirAll(cacheDir, os.FileMode(0755))
chunkCache := chunk_cache.NewTieredChunkCache(256, cacheDir, option.CacheSizeMB, 1024*1024)
chunkCache := chunk_cache.NewTieredChunkCache(256, cacheDir, option.CacheSizeMB, 1024*1024, option.ForceCache)
t := &WebDavFileSystem{
option: option,
chunkCache: chunkCache,