From f41bd47bf95dabfa3d0e6cb110e751e7cd43f138 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 19 Dec 2025 13:17:29 +0000 Subject: refactor: rename connect_and_subscribe to connect Separated connection from subscription logic. The RelayConnection.connect() method now only handles WebSocket connection establishment. Subscriptions are managed separately via handle_connect_or_reconnect. Changes: - Renamed RelayConnection::connect_and_subscribe() to connect() - Removed subscription logic from connect method - Updated call site in try_connect_relay() - Removed unused build_announcement_filter import --- src/sync/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/sync/mod.rs') diff --git a/src/sync/mod.rs b/src/sync/mod.rs index 85ab680..3f8e503 100644 --- a/src/sync/mod.rs +++ b/src/sync/mod.rs @@ -1205,8 +1205,8 @@ impl SyncManager { let timeout = self.health_tracker.base_backoff_secs(); - match connection.connect_and_subscribe(None, timeout).await { - Ok(_) => { + match connection.connect(timeout).await { + Ok(()) => { // Success - record and send notification self.health_tracker.record_success(relay_url); @@ -1346,7 +1346,7 @@ impl SyncManager { // 3. Keep RelayConnection in HashMap for reuse on reconnect // The connection object persists and will be reused when retry_disconnected_relays - // calls try_connect_relay -> connection.connect_and_subscribe() + // calls try_connect_relay -> connection.connect() tracing::debug!( relay = %relay_url, "Keeping RelayConnection in HashMap for reconnection" -- cgit v1.2.3