From 76b7bcd4d7a95d52aff567373970d31c45e33327 Mon Sep 17 00:00:00 2001 From: nielash Date: Tue, 9 Jan 2024 04:08:57 -0500 Subject: [PATCH] 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. --- cmd/bisync/queue.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/bisync/queue.go b/cmd/bisync/queue.go index 8b5cd0801..73d9f18e6 100644 --- a/cmd/bisync/queue.go +++ b/cmd/bisync/queue.go @@ -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 { 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) + accounting.GlobalStats().ResetErrors() results, err = b.fastCopy(ctx, fsrc, fdst, files, queueName) + if err == nil || b.InGracefulShutdown { + return results, err + } } } return results, err