operations: fall back when source ignores ranges
When a multi-thread source ignores ranged reads, abort the partial destination and retry the copy as a single stream. Reset accounting before the fallback so transfer progress remains accurate.
This commit is contained in:
@@ -266,7 +266,12 @@ func (c *copy) manualCopy(ctx context.Context) (actionTaken string, newDst fs.Ob
|
||||
}
|
||||
|
||||
if doMultiThreadCopy(ctx, c.f, c.src) {
|
||||
return c.multiThreadCopy(ctx, uploadOptions)
|
||||
actionTaken, newDst, err = c.multiThreadCopy(ctx, uploadOptions)
|
||||
if !errors.Is(err, fs.ErrorRangeIgnored) {
|
||||
return actionTaken, newDst, err
|
||||
}
|
||||
fs.Logf(c.src, "multi-thread copy: %v: downloading in a single stream", err)
|
||||
c.tr.Reset(ctx)
|
||||
}
|
||||
|
||||
var in io.ReadCloser
|
||||
|
||||
Reference in New Issue
Block a user