mirror of
https://github.com/rclone/rclone.git
synced 2025-01-13 20:38:12 +02:00
bisync: reset errors between retries
Before this change, in the event of a retryable error, bisync would always retry the maximum number of times allowed by the `--retries` flag, even if one of the retries was successful. This change fixes the issue, so that bisync moves on after the first successful retry.
This commit is contained in:
parent
782ab3f582
commit
76b7bcd4d7
@ -265,7 +265,11 @@ func (b *bisyncRun) retryFastCopy(ctx context.Context, fsrc, fdst fs.Fs, files b
|
|||||||
if err != nil && b.opt.Resilient && !b.InGracefulShutdown && b.opt.Retries > 1 {
|
if err != nil && b.opt.Resilient && !b.InGracefulShutdown && b.opt.Retries > 1 {
|
||||||
for tries := 1; tries <= b.opt.Retries; tries++ {
|
for tries := 1; tries <= b.opt.Retries; tries++ {
|
||||||
fs.Logf(queueName, Color(terminal.YellowFg, "Received error: %v - retrying as --resilient is set. Retry %d/%d"), err, tries, b.opt.Retries)
|
fs.Logf(queueName, Color(terminal.YellowFg, "Received error: %v - retrying as --resilient is set. Retry %d/%d"), err, tries, b.opt.Retries)
|
||||||
|
accounting.GlobalStats().ResetErrors()
|
||||||
results, err = b.fastCopy(ctx, fsrc, fdst, files, queueName)
|
results, err = b.fastCopy(ctx, fsrc, fdst, files, queueName)
|
||||||
|
if err == nil || b.InGracefulShutdown {
|
||||||
|
return results, err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return results, err
|
return results, err
|
||||||
|
Loading…
Reference in New Issue
Block a user