From 76430790b996b868dc8e9bdcbd4026b9e0a0c499 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 31 Jan 2021 22:02:03 -0800 Subject: [PATCH] webdav: cache to version specific folder --- weed/server/webdav_server.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/weed/server/webdav_server.go b/weed/server/webdav_server.go index feb193230..1afb71aee 100644 --- a/weed/server/webdav_server.go +++ b/weed/server/webdav_server.go @@ -105,7 +105,10 @@ type WebDavFile struct { func NewWebDavFileSystem(option *WebDavOption) (webdav.FileSystem, error) { - chunkCache := chunk_cache.NewTieredChunkCache(256, option.CacheDir, option.CacheSizeMB, 1024*1024) + cacheUniqueId := util.Md5String([]byte("webdav" + option.FilerGrpcAddress + util.Version()))[0:8] + cacheDir := path.Join(option.CacheDir, cacheUniqueId) + + chunkCache := chunk_cache.NewTieredChunkCache(256, cacheDir, option.CacheSizeMB, 1024*1024) return &WebDavFileSystem{ option: option, chunkCache: chunkCache,