"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
amazonclouddrive: remove unnecessary notifies from DirChangeNotify
Fabian Möllera3dd2c691e26
diff --git a/backend/amazonclouddrive/amazonclouddrive.go b/backend/amazonclouddrive/amazonclouddrive.goindex 569f97bff..e7d6486dc 100644--- a/backend/amazonclouddrive/amazonclouddrive.go+++ b/backend/amazonclouddrive/amazonclouddrive.go@@ -1264,21 +1264,17 @@ func (f *Fs) dirchangeNotifyRunner(notifyFunc func(string), checkpoint string) sif path, ok := f.dirCache.GetInv(*node.Id); ok {pathsToClear = append(pathsToClear, path)}-- for _, parent := range node.Parents {- if path, ok := f.dirCache.GetInv(parent); ok {- pathsToClear = append(pathsToClear, path)- }- }}+ notified := falselastNotifiedPath := ""sort.Strings(pathsToClear)for _, path := range pathsToClear {- if lastNotifiedPath != "" && (path == lastNotifiedPath || strings.HasPrefix(path+"/", lastNotifiedPath)) {+ if notified && strings.HasPrefix(path+"/", lastNotifiedPath+"/") {continue}lastNotifiedPath = path+ notified = truenotifyFunc(path)}