"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
operations: Don't use multi-thread copy if the backend doesn't support it #6915
Nick Craig-Wood46a323ae1452
diff --git a/fs/operations/multithread.go b/fs/operations/multithread.goindex b8ace21d5..62812dc00 100644--- a/fs/operations/multithread.go+++ b/fs/operations/multithread.go@@ -28,11 +28,15 @@ func doMultiThreadCopy(ctx context.Context, f fs.Fs, src fs.Object) bool {if ci.MultiThreadStreams <= 1 {return false}+ // ...if the source doesn't support it+ if src.Fs().Features().NoMultiThreading {+ return false+ }// ...size of object is less than cutoffif src.Size() < int64(ci.MultiThreadCutoff) {return false}- // ...source doesn't support it+ // ...destination doesn't support itdstFeatures := f.Features()if dstFeatures.OpenWriterAt == nil {return falsediff --git a/fs/operations/multithread_test.go b/fs/operations/multithread_test.goindex fa982cf59..aef6f75af 100644--- a/fs/operations/multithread_test.go+++ b/fs/operations/multithread_test.go@@ -79,6 +79,11 @@ func TestDoMultiThreadCopy(t *testing.T) {assert.True(t, doMultiThreadCopy(ctx, f, src))srcFs.Features().IsLocal = falseassert.True(t, doMultiThreadCopy(ctx, f, src))++ srcFs.Features().NoMultiThreading = true+ assert.False(t, doMultiThreadCopy(ctx, f, src))+ srcFs.Features().NoMultiThreading = false+ assert.True(t, doMultiThreadCopy(ctx, f, src))}func TestMultithreadCalculateChunks(t *testing.T) {