Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

vfs: Add FlushDirCache method

Nick Craig-Wood9738f8532bc2
diff --git a/vfs/vfs.go b/vfs/vfs.go
index 858ea6ae6..14e646a25 100644
--- a/vfs/vfs.go
+++ b/vfs/vfs.go
@@ -243,11 +243,15 @@ func (vfs *VFS) Shutdown() {
}
}
-// CleanUp deletes the contents of the cache
+// CleanUp deletes the contents of the on disk cache
func (vfs *VFS) CleanUp() error {
return vfs.cache.cleanUp()
}
+// FlushDirCache empties the directory cache
+func (vfs *VFS) FlushDirCache() {
+ vfs.root.ForgetAll()
+}
// WaitForWriters sleeps until all writers have finished or
// time.Duration has elapsed