diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-11 11:57:36 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-11 11:57:36 +0000 |
| commit | 4941490233a728bc7c64fa80a53d15f772a1219f (patch) | |
| tree | 7fc1bbf6114deb29b5a736b467abf785ea915f02 /src/config.rs | |
| parent | 6cd7535f2d5f65477ef11b17a4661745ec3a2881 (diff) | |
sync: add sync_base_backoff_secs config for better testing
Diffstat (limited to 'src/config.rs')
| -rw-r--r-- | src/config.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs index 5e74471..178e840 100644 --- a/src/config.rs +++ b/src/config.rs | |||
| @@ -114,6 +114,13 @@ pub struct Config { | |||
| 114 | /// Set to lower value for faster reconnection testing | 114 | /// Set to lower value for faster reconnection testing |
| 115 | #[arg(long, env = "NGIT_SYNC_DISCONNECT_CHECK_INTERVAL_SECS", default_value_t = 60)] | 115 | #[arg(long, env = "NGIT_SYNC_DISCONNECT_CHECK_INTERVAL_SECS", default_value_t = 60)] |
| 116 | pub sync_disconnect_check_interval_secs: u64, | 116 | pub sync_disconnect_check_interval_secs: u64, |
| 117 | |||
| 118 | /// Base backoff time in seconds for relay reconnection (default: 5) | ||
| 119 | /// Used for exponential backoff: base * 2^(failures-1) | ||
| 120 | /// Set to 1 for faster test cycles | ||
| 121 | /// Note: The connection timeout is capped at this value | ||
| 122 | #[arg(long, env = "NGIT_SYNC_BASE_BACKOFF_SECS", default_value_t = 5)] | ||
| 123 | pub sync_base_backoff_secs: u64, | ||
| 117 | } | 124 | } |
| 118 | 125 | ||
| 119 | impl Config { | 126 | impl Config { |
| @@ -176,6 +183,7 @@ impl Config { | |||
| 176 | sync_reconnect_lookback_days: 3, | 183 | sync_reconnect_lookback_days: 3, |
| 177 | sync_startup_jitter_ms: 10_000, | 184 | sync_startup_jitter_ms: 10_000, |
| 178 | sync_disconnect_check_interval_secs: 60, | 185 | sync_disconnect_check_interval_secs: 60, |
| 186 | sync_base_backoff_secs: 5, | ||
| 179 | } | 187 | } |
| 180 | } | 188 | } |
| 181 | } | 189 | } |