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/sync/mod.rs | |
| parent | 6cd7535f2d5f65477ef11b17a4661745ec3a2881 (diff) | |
sync: add sync_base_backoff_secs config for better testing
Diffstat (limited to 'src/sync/mod.rs')
| -rw-r--r-- | src/sync/mod.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/sync/mod.rs b/src/sync/mod.rs index 16ad833..21f31df 100644 --- a/src/sync/mod.rs +++ b/src/sync/mod.rs | |||
| @@ -1184,8 +1184,12 @@ impl SyncManager { | |||
| 1184 | // Create relay connection | 1184 | // Create relay connection |
| 1185 | let connection = RelayConnection::new(relay_url.clone()); | 1185 | let connection = RelayConnection::new(relay_url.clone()); |
| 1186 | 1186 | ||
| 1187 | // Get connection timeout from health tracker (capped at base backoff) | ||
| 1188 | // This ensures the connection attempt completes before the next retry would be scheduled | ||
| 1189 | let connection_timeout_secs = self.health_tracker.base_backoff_secs(); | ||
| 1190 | |||
| 1187 | // Connect and subscribe to Layer 1 | 1191 | // Connect and subscribe to Layer 1 |
| 1188 | match connection.connect_and_subscribe(None).await { | 1192 | match connection.connect_and_subscribe(None, connection_timeout_secs).await { |
| 1189 | Ok(_) => { | 1193 | Ok(_) => { |
| 1190 | // Record successful connection attempt | 1194 | // Record successful connection attempt |
| 1191 | if let Some(ref metrics) = self.metrics { | 1195 | if let Some(ref metrics) = self.metrics { |