Skip to content

Commit 5482a3e

Browse files
authored
Merge pull request #163 from filmil/remove-special-codepath
git-sync: removes special exit on first error
2 parents aa241c2 + bbf6d60 commit 5482a3e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmd/git-sync/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,8 @@ func main() {
289289
if changed, err := syncRepo(ctx, *flRepo, *flBranch, *flRev, *flDepth, *flRoot, *flDest); err != nil {
290290
syncDuration.WithLabelValues("error").Observe(time.Now().Sub(start).Seconds())
291291
syncCount.WithLabelValues("error").Inc()
292-
if initialSync || (*flMaxSyncFailures != -1 && failCount >= *flMaxSyncFailures) {
292+
if *flMaxSyncFailures != -1 && failCount >= *flMaxSyncFailures {
293+
// Exit after too many retries, maybe the error is not recoverable.
293294
log.Error(err, "failed to sync repo, aborting")
294295
os.Exit(1)
295296
}

0 commit comments

Comments
 (0)