aboutsummaryrefslogtreecommitdiff
path: root/weed/mount/weedfs.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/mount/weedfs.go')
-rw-r--r--weed/mount/weedfs.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/weed/mount/weedfs.go b/weed/mount/weedfs.go
index 7b67a8f32..77ffb7e77 100644
--- a/weed/mount/weedfs.go
+++ b/weed/mount/weedfs.go
@@ -224,6 +224,12 @@ func (wfs *WFS) getCurrentFiler() pb.ServerAddress {
return wfs.option.FilerAddresses[i]
}
+func (wfs *WFS) ClearCacheDir() {
+ wfs.metaCache.Shutdown()
+ os.RemoveAll(wfs.option.getUniqueCacheDirForWrite())
+ os.RemoveAll(wfs.option.getUniqueCacheDirForRead())
+}
+
func (option *Option) setupUniqueCacheDirectory() {
cacheUniqueId := util.Md5String([]byte(option.MountDirectory + string(option.FilerAddresses[0]) + option.FilerMountRootPath + util.Version()))[0:8]
option.uniqueCacheDirForRead = path.Join(option.CacheDirForRead, cacheUniqueId)