"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
filescom: fix corrupted uploads after a retried upload error
Nick Craig-Woodfa43f10af232
diff --git a/backend/filescom/filescom.go b/backend/filescom/filescom.goindex 6e53016d0..63c577e51 100644--- a/backend/filescom/filescom.go+++ b/backend/filescom/filescom.go@@ -19,6 +19,7 @@ import ("github.com/Files-com/files-sdk-go/v3/file"file_migration "github.com/Files-com/files-sdk-go/v3/filemigration""github.com/Files-com/files-sdk-go/v3/folder"+ files_sdk_lib "github.com/Files-com/files-sdk-go/v3/lib""github.com/Files-com/files-sdk-go/v3/session""github.com/rclone/rclone/fs""github.com/rclone/rclone/fs/config"@@ -176,6 +177,13 @@ func shouldRetry(ctx context.Context, err error) (bool, error) {}}+ // Errors from the upload storage servers are of this type+ var httpErr files_sdk_lib.ResponseError+ if errors.As(err, &httpErr) && slices.Contains(retryErrorCodes, httpErr.StatusCode) {+ fs.Debugf(nil, "Retrying HTTP error %v", err)+ return true, err+ }+return fserrors.ShouldRetry(err), err}@@ -853,7 +861,7 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, opfile.UploadWithProvidedMtime(src.ModTime(ctx)),}- err := o.fs.pacer.Call(func() (bool, error) {+ err := o.fs.pacer.CallNoRetry(func() (bool, error) {err := o.fs.fileClient.Upload(uploadOpts...)return shouldRetry(ctx, err)})