You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add --init-period and --init-max-failures flags (#980)
* add init-period flag for faster initial sync retries
* address review: alphabetize flags, add readme docs, add e2e tests
* move init flags to alphabetical order in man text
* fix init-timeout e2e test to actually trigger init timeout
* switch init-timeout to init-max-failures per review
- rename flag and helper to count-based (int, not duration)
- skip --max-failures during init when init-max-failures is set so main-max does not override init tolerance
- add SYNC PHASES section to --man and README describing init vs steady-state
- update e2e test to use a bad server path, as suggested in review
* address review: simplify closure, use pflag.Changed for init-max-failures
- move flInitMaxFailures next to flMaxFailures
- default flInitPeriod to flPeriod to kill conditional in hot path
- replace isInitFailuresExceeded + useMainLimit with getMaxFailures closure
- track waitTime as a loop-outer variable, flip on init-done
- detect --init-max-failures via pflag.Changed || GITSYNC_INIT_MAX_FAILURES env; -1 = unlimited, 0 = abort immediately, unset = fall through to --max-failures
- drop now-stale unit tests for removed helpers, update --man and README
"the number of consecutive failures allowed before aborting (-1 will retry forever")
204
+
flInitMaxFailures:=pflag.Int("init-max-failures",
205
+
envInt(0, "GITSYNC_INIT_MAX_FAILURES"),
206
+
"the number of consecutive failures allowed before aborting during the initial sync phase; a negative value retries forever; if unset, --max-failures applies instead")
0 commit comments