operations: disable multi thread copy for local to local copies #3419

...unless --multi-thread-streams has been set explicitly
This commit is contained in:
Nick Craig-Wood
2019-08-12 22:09:40 +01:00
parent ec8e0a6c58
commit eb087a3b04
6 changed files with 100 additions and 1 deletions

View File

@ -310,7 +310,7 @@ func Copy(ctx context.Context, f fs.Fs, dst fs.Object, remote string, src fs.Obj
}
// If can't server side copy, do it manually
if err == fs.ErrorCantCopy {
if doOpenWriterAt := f.Features().OpenWriterAt; doOpenWriterAt != nil && src.Size() >= int64(fs.Config.MultiThreadCutoff) && fs.Config.MultiThreadStreams > 1 {
if doMultiThreadCopy(f, src) {
// Number of streams proportional to size
streams := src.Size() / int64(fs.Config.MultiThreadCutoff)
// With maximum