Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

b2: automatically raise upload cutoff to avoid spurious error

Nick Craig-Wood9710ded60fa2
diff --git a/backend/b2/b2.go b/backend/b2/b2.go
index c15b02d93..307a45ea8 100644
--- a/backend/b2/b2.go
+++ b/backend/b2/b2.go
@@ -403,6 +403,10 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e
if err != nil {
return nil, err
}
+ if opt.UploadCutoff < opt.ChunkSize {
+ opt.UploadCutoff = opt.ChunkSize
+ fs.Infof(nil, "b2: raising upload cutoff to chunk size: %v", opt.UploadCutoff)
+ }
err = checkUploadCutoff(opt, opt.UploadCutoff)
if err != nil {
return nil, errors.Wrap(err, "b2: upload cutoff")