diff options
Diffstat (limited to 'src/sync/mod.rs')
| -rw-r--r-- | src/sync/mod.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/sync/mod.rs b/src/sync/mod.rs index fb09896..9ac62ed 100644 --- a/src/sync/mod.rs +++ b/src/sync/mod.rs | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | pub mod algorithms; | 15 | pub mod algorithms; |
| 16 | pub mod filters; | 16 | pub mod filters; |
| 17 | pub mod health; | ||
| 17 | pub mod relay_connection; | 18 | pub mod relay_connection; |
| 18 | pub mod self_subscriber; | 19 | pub mod self_subscriber; |
| 19 | 20 | ||
| @@ -26,6 +27,9 @@ pub use relay_connection::{RelayConnection, RelayEvent}; | |||
| 26 | // Re-export self-subscriber types | 27 | // Re-export self-subscriber types |
| 27 | pub use self_subscriber::{RelayAction, SelfSubscriber}; | 28 | pub use self_subscriber::{RelayAction, SelfSubscriber}; |
| 28 | 29 | ||
| 30 | // Re-export health tracking types | ||
| 31 | pub use health::RelayHealthTracker; | ||
| 32 | |||
| 29 | use std::collections::{HashMap, HashSet}; | 33 | use std::collections::{HashMap, HashSet}; |
| 30 | use std::sync::Arc; | 34 | use std::sync::Arc; |
| 31 | 35 | ||
| @@ -339,6 +343,12 @@ pub struct SyncManager { | |||
| 339 | relay_sync_index: RelaySyncIndex, | 343 | relay_sync_index: RelaySyncIndex, |
| 340 | /// In-flight subscription batches | 344 | /// In-flight subscription batches |
| 341 | pending_sync_index: PendingSyncIndex, | 345 | pending_sync_index: PendingSyncIndex, |
| 346 | /// Active relay connections - keyed by relay URL | ||
| 347 | connections: HashMap<String, RelayConnection>, | ||
| 348 | /// Health tracker for relay connection state | ||
| 349 | health_tracker: Arc<RelayHealthTracker>, | ||
| 350 | /// Counter for generating unique batch IDs | ||
| 351 | next_batch_id: u64, | ||
| 342 | } | 352 | } |
| 343 | 353 | ||
| 344 | impl SyncManager { | 354 | impl SyncManager { |
| @@ -366,6 +376,9 @@ impl SyncManager { | |||
| 366 | repo_sync_index: Arc::new(RwLock::new(HashMap::new())), | 376 | repo_sync_index: Arc::new(RwLock::new(HashMap::new())), |
| 367 | relay_sync_index: Arc::new(RwLock::new(HashMap::new())), | 377 | relay_sync_index: Arc::new(RwLock::new(HashMap::new())), |
| 368 | pending_sync_index: Arc::new(RwLock::new(HashMap::new())), | 378 | pending_sync_index: Arc::new(RwLock::new(HashMap::new())), |
| 379 | connections: HashMap::new(), | ||
| 380 | health_tracker: Arc::new(RelayHealthTracker::new(config)), | ||
| 381 | next_batch_id: 0, | ||
| 369 | } | 382 | } |
| 370 | } | 383 | } |
| 371 | 384 | ||