From 661afae9832eb4d5eda207a28bc5723ec1ac20be Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Sun, 3 Apr 2022 00:16:34 +0100 Subject: [PATCH] mirror: Do not exit upon errors when --watch is passed (#4032) Currently, when mirror is not able to copy an object (e.g. corrupted) and watch is specified, mirror will restart mirroring again to stop again at the same problematic object. Co-authored-by: Anis Elleuch --- cmd/mirror-main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/mirror-main.go b/cmd/mirror-main.go index 0d67cff6..a5156f8f 100644 --- a/cmd/mirror-main.go +++ b/cmd/mirror-main.go @@ -510,11 +510,13 @@ func (mj *mirrorJob) monitorMirrorStatus(cancel context.CancelFunc) (errDuringMi errDuringMirror = true } - if mj.opts.activeActive { + // Do not quit mirroring if we are in --watch or --active-active mode + if !mj.opts.activeActive && !mj.opts.isWatch { cancel() cancelInProgress = true - continue } + + continue } if sURLs.SourceContent != nil {