"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
dropbox: migrate from deprecated api
m8rge5d6a6dd6c012
diff --git a/backend/dropbox/batcher.go b/backend/dropbox/batcher.goindex 96185dde3..ac87c71e0 100644--- a/backend/dropbox/batcher.go+++ b/backend/dropbox/batcher.go@@ -118,12 +118,12 @@ func (b *batcher) Batching() bool {}// finishBatch commits the batch, returning a batch status to poll or maybe complete-func (b *batcher) finishBatch(ctx context.Context, items []*files.UploadSessionFinishArg) (batchStatus *files.UploadSessionFinishBatchLaunch, err error) {+func (b *batcher) finishBatch(ctx context.Context, items []*files.UploadSessionFinishArg) (complete *files.UploadSessionFinishBatchResult, err error) {var arg = &files.UploadSessionFinishBatchArg{Entries: items,}err = b.f.pacer.Call(func() (bool, error) {- batchStatus, err = b.f.srv.UploadSessionFinishBatch(arg)+ complete, err = b.f.srv.UploadSessionFinishBatchV2(arg)// If error is insufficient space then don't retryif e, ok := err.(files.UploadSessionFinishAPIError); ok {if e.EndpointError != nil && e.EndpointError.Path != nil && e.EndpointError.Path.Tag == files.WriteErrorInsufficientSpace {@@ -137,7 +137,7 @@ func (b *batcher) finishBatch(ctx context.Context, items []*files.UploadSessionFif err != nil {return nil, fmt.Errorf("batch commit failed: %w", err)}- return batchStatus, nil+ return complete, nil}// finishBatchJobStatus waits for the batch to complete returning completed entries@@ -199,26 +199,11 @@ func (b *batcher) commitBatch(ctx context.Context, items []*files.UploadSessionFfs.Debugf(b.f, "Committing %s", desc)// finalise the batch getting either a result or a job id to poll- batchStatus, err := b.finishBatch(ctx, items)+ complete, err := b.finishBatch(ctx, items)if err != nil {return err}- // check whether batch is complete- var complete *files.UploadSessionFinishBatchResult- switch batchStatus.Tag {- case "async_job_id":- // wait for batch to complete- complete, err = b.finishBatchJobStatus(ctx, batchStatus)- if err != nil {- return err- }- case "complete":- complete = batchStatus.Complete- default:- return fmt.Errorf("batch returned unknown status %q", batchStatus.Tag)- }-// Check we got the right number of entriesentries := complete.Entriesif len(entries) != len(results) {