diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-11 13:29:30 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-11 13:29:30 +0000 |
| commit | 0f1ea0290d1b5418ec1d22bfa7c837e767a35d6c (patch) | |
| tree | ebc3294f956ee4f647f32aed6773401bc4d6d025 /src | |
| parent | 9d1545b7b13bc6cd3b0a075865918ceaad9e07ff (diff) | |
chore: remove unused sync config fields
Remove 4 config fields that were defined but never used:
- sync_startup_delay_secs
- sync_reconnect_delay_secs
- sync_reconnect_lookback_days
- sync_startup_jitter_ms
These fields were added during GRASP-02 planning but the implementation
took a different approach (using hardcoded constants for quick reconnect
windows and batch window via env var).
Diffstat (limited to 'src')
| -rw-r--r-- | src/config.rs | 21 | ||||
| -rw-r--r-- | src/http/nip11.rs | 8 |
2 files changed, 0 insertions, 29 deletions
diff --git a/src/config.rs b/src/config.rs index 178e840..f3a3e2a 100644 --- a/src/config.rs +++ b/src/config.rs | |||
| @@ -93,23 +93,6 @@ pub struct Config { | |||
| 93 | #[arg(long, env = "NGIT_SYNC_MAX_BACKOFF_SECS", default_value_t = 3600)] | 93 | #[arg(long, env = "NGIT_SYNC_MAX_BACKOFF_SECS", default_value_t = 3600)] |
| 94 | pub sync_max_backoff_secs: u64, | 94 | pub sync_max_backoff_secs: u64, |
| 95 | 95 | ||
| 96 | /// Delay in seconds before running startup catchup (default: 30) | ||
| 97 | #[arg(long, env = "NGIT_SYNC_STARTUP_DELAY_SECS", default_value_t = 30)] | ||
| 98 | pub sync_startup_delay_secs: u64, | ||
| 99 | |||
| 100 | /// Delay in seconds before running reconnect catchup (default: 10) | ||
| 101 | #[arg(long, env = "NGIT_SYNC_RECONNECT_DELAY_SECS", default_value_t = 10)] | ||
| 102 | pub sync_reconnect_delay_secs: u64, | ||
| 103 | |||
| 104 | /// Number of days to look back for reconnect catchup (default: 3) | ||
| 105 | #[arg(long, env = "NGIT_SYNC_RECONNECT_LOOKBACK_DAYS", default_value_t = 3)] | ||
| 106 | pub sync_reconnect_lookback_days: u64, | ||
| 107 | |||
| 108 | /// Maximum startup jitter in milliseconds for sync connections (default: 10000 = 10 seconds) | ||
| 109 | /// Set to 0 to disable jitter (useful for testing) | ||
| 110 | #[arg(long, env = "NGIT_SYNC_STARTUP_JITTER_MS", default_value_t = 10_000)] | ||
| 111 | pub sync_startup_jitter_ms: u64, | ||
| 112 | |||
| 113 | /// Interval in seconds for checking disconnected relays and attempting reconnection (default: 60) | 96 | /// Interval in seconds for checking disconnected relays and attempting reconnection (default: 60) |
| 114 | /// Set to lower value for faster reconnection testing | 97 | /// Set to lower value for faster reconnection testing |
| 115 | #[arg(long, env = "NGIT_SYNC_DISCONNECT_CHECK_INTERVAL_SECS", default_value_t = 60)] | 98 | #[arg(long, env = "NGIT_SYNC_DISCONNECT_CHECK_INTERVAL_SECS", default_value_t = 60)] |
| @@ -178,10 +161,6 @@ impl Config { | |||
| 178 | metrics_top_n_repos: 10, | 161 | metrics_top_n_repos: 10, |
| 179 | sync_bootstrap_relay_url: None, | 162 | sync_bootstrap_relay_url: None, |
| 180 | sync_max_backoff_secs: 3600, | 163 | sync_max_backoff_secs: 3600, |
| 181 | sync_startup_delay_secs: 30, | ||
| 182 | sync_reconnect_delay_secs: 10, | ||
| 183 | sync_reconnect_lookback_days: 3, | ||
| 184 | sync_startup_jitter_ms: 10_000, | ||
| 185 | sync_disconnect_check_interval_secs: 60, | 164 | sync_disconnect_check_interval_secs: 60, |
| 186 | sync_base_backoff_secs: 5, | 165 | sync_base_backoff_secs: 5, |
| 187 | } | 166 | } |
diff --git a/src/http/nip11.rs b/src/http/nip11.rs index 19d482f..8c18dde 100644 --- a/src/http/nip11.rs +++ b/src/http/nip11.rs | |||
| @@ -107,10 +107,6 @@ mod tests { | |||
| 107 | metrics_top_n_repos: 10, | 107 | metrics_top_n_repos: 10, |
| 108 | sync_bootstrap_relay_url: None, | 108 | sync_bootstrap_relay_url: None, |
| 109 | sync_max_backoff_secs: 3600, | 109 | sync_max_backoff_secs: 3600, |
| 110 | sync_startup_delay_secs: 30, | ||
| 111 | sync_reconnect_delay_secs: 10, | ||
| 112 | sync_reconnect_lookback_days: 3, | ||
| 113 | sync_startup_jitter_ms: 10_000, | ||
| 114 | sync_disconnect_check_interval_secs: 60, | 110 | sync_disconnect_check_interval_secs: 60, |
| 115 | sync_base_backoff_secs: 5, | 111 | sync_base_backoff_secs: 5, |
| 116 | }; | 112 | }; |
| @@ -149,10 +145,6 @@ mod tests { | |||
| 149 | metrics_top_n_repos: 10, | 145 | metrics_top_n_repos: 10, |
| 150 | sync_bootstrap_relay_url: None, | 146 | sync_bootstrap_relay_url: None, |
| 151 | sync_max_backoff_secs: 3600, | 147 | sync_max_backoff_secs: 3600, |
| 152 | sync_startup_delay_secs: 30, | ||
| 153 | sync_reconnect_delay_secs: 10, | ||
| 154 | sync_reconnect_lookback_days: 3, | ||
| 155 | sync_startup_jitter_ms: 10_000, | ||
| 156 | sync_disconnect_check_interval_secs: 60, | 148 | sync_disconnect_check_interval_secs: 60, |
| 157 | sync_base_backoff_secs: 5, | 149 | sync_base_backoff_secs: 5, |
| 158 | }; | 150 | }; |