fs/operations: Clear accounting before low level retry

Statistics of ransfers which were interrupted are not cleared before
retry iteration. These transfers completed with over 100 percentage.

This change clears transfer accounting before next retry iteration is
done in order to keep numbers in track.

Fixes #3861
This commit is contained in:
Maciej Zimnoch 2020-01-08 15:17:24 +01:00 committed by Nick Craig-Wood
parent 27c3481ea4
commit b7019a91c2

View File

@ -402,6 +402,7 @@ func Copy(ctx context.Context, f fs.Fs, dst fs.Object, remote string, src fs.Obj
// Retry if err returned a retry error
if fserrors.IsRetryError(err) || fserrors.ShouldRetry(err) {
fs.Debugf(src, "Received error: %v - low level retry %d/%d", err, tries, maxTries)
tr.Reset() // skip incomplete accounting - will be overwritten by retry
continue
}
// otherwise finish