1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-30 15:13:55 +00:00

vfs: Only make the VFS cache if --vfs-cache-mode > Off

This stops the cache cleaner running unnecessarily and saves
resources.

This also helps with issue #2227 which was caused by a second mount
deleting objects in the first mounts cache.
This commit is contained in:
Nick Craig-Wood
2018-04-16 16:38:32 +01:00
parent 3d5106e52b
commit 2b7957cc74
4 changed files with 33 additions and 18 deletions

View File

@@ -215,7 +215,7 @@ func (r *Run) cacheMode(cacheMode vfs.CacheMode) {
log.Printf("Failed to cleanup the VFS cache: %v", err)
}
// Reset the cache mode
r.vfs.Opt.CacheMode = cacheMode
r.vfs.SetCacheMode(cacheMode)
// Flush the directory cache
r.vfs.FlushDirCache()