"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: fix race detected by race detector
Nick Craig-Wood2c72842c1001
diff --git a/vfs/dir.go b/vfs/dir.goindex da0f8d47c..c72494eee 100644--- a/vfs/dir.go+++ b/vfs/dir.go@@ -66,7 +66,10 @@ func newDir(vfs *VFS, f fs.Fs, parent *Dir, fsDir fs.Directory) *Dir {inode: newInode(),items: make(map[string]Node),}- d.cleanupTimer = time.AfterFunc(time.Duration(vfs.Opt.DirCacheTime*2), d.cacheCleanup)+ // Set timer up like this to avoid race of d.cacheCleanup being called+ // before d.cleanupTimer is assigned to+ d.cleanupTimer = time.AfterFunc(time.Hour, d.cacheCleanup)+ d.cleanupTimer.Reset(time.Duration(vfs.Opt.DirCacheTime * 2))return d}