"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
vfs: disable cache cleaner if --vfs-cache-poll-interval=0
Nick Craig-Wood442334ba61a3
diff --git a/vfs/cache.go b/vfs/cache.goindex 3ca68f712..302d98dd9 100644--- a/vfs/cache.go+++ b/vfs/cache.go@@ -387,6 +387,10 @@ func (c *cache) clean() {//// doesn't return until context is cancelledfunc (c *cache) cleaner(ctx context.Context) {+ if c.opt.CachePollInterval <= 0 {+ fs.Debugf(nil, "Cache cleaning thread disabled because poll interval <= 0")+ return+ }// Start cleaning the cache immediatelyc.clean()// Then every interval specifieddiff --git a/vfs/cache_test.go b/vfs/cache_test.goindex 5b8fd1f0f..200a68aea 100644--- a/vfs/cache_test.go+++ b/vfs/cache_test.go@@ -63,9 +63,12 @@ func TestCacheNew(t *testing.T) {defer r.Finalise()ctx, cancel := context.WithCancel(context.Background())+ defer cancel()- c, err := newCache(ctx, r.Fremote, &DefaultOpt)- cancel() // kill the background cache cleaning as it interferes with the tests+ // Disable the cache cleaner as it interferes with these tests+ opt := DefaultOpt+ opt.CachePollInterval = 0+ c, err := newCache(ctx, r.Fremote, &opt)require.NoError(t, err)assert.Contains(t, c.root, "vfs")