From f639ecfac6687c9e8de4e3f305e168b2e4e1bb87 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 4 Dec 2025 17:58:31 +0000 Subject: feat(sync): Phase 3 - resilience and health tracking - Add RelayHealthTracker with DashMap - Implement exponential backoff (5s -> 1h max) - Handle dead relays (24h failures -> daily retry) - Add startup jitter to prevent thundering herd - Add NGIT_SYNC_MAX_BACKOFF_SECS config --- src/config.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/config.rs') diff --git a/src/config.rs b/src/config.rs index a2a27be..441a14d 100644 --- a/src/config.rs +++ b/src/config.rs @@ -87,6 +87,10 @@ pub struct Config { /// URL of relay to sync kind 30617 events from (optional, enables proactive sync) #[arg(long, env = "NGIT_SYNC_RELAY_URL")] pub sync_relay_url: Option, + + /// Maximum backoff time in seconds for sync relay reconnection (default: 3600 = 1 hour) + #[arg(long, env = "NGIT_SYNC_MAX_BACKOFF_SECS", default_value_t = 3600)] + pub sync_max_backoff_secs: u64, } impl Config { @@ -143,6 +147,7 @@ impl Config { metrics_connection_per_ip_abuse_threshold: 10, metrics_top_n_repos: 10, sync_relay_url: None, + sync_max_backoff_secs: 3600, } } } -- cgit v1.2.3