upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/sync/mod.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2025-12-19 13:17:29 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2025-12-19 13:17:29 +0000
commitf41bd47bf95dabfa3d0e6cb110e751e7cd43f138 (patch)
treefe4448ba583d6bc7f49de5bcf0e9c2bb5f8c5cfa /src/sync/mod.rs
parent7e72cf46961852c650935633c0164f38c736aca5 (diff)
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
Diffstat (limited to 'src/sync/mod.rs')
-rw-r--r--src/sync/mod.rs6
1 files changed, 3 insertions, 3 deletions
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 {
1205 1205
1206 let timeout = self.health_tracker.base_backoff_secs(); 1206 let timeout = self.health_tracker.base_backoff_secs();
1207 1207
1208 match connection.connect_and_subscribe(None, timeout).await { 1208 match connection.connect(timeout).await {
1209 Ok(_) => { 1209 Ok(()) => {
1210 // Success - record and send notification 1210 // Success - record and send notification
1211 self.health_tracker.record_success(relay_url); 1211 self.health_tracker.record_success(relay_url);
1212 1212
@@ -1346,7 +1346,7 @@ impl SyncManager {
1346 1346
1347 // 3. Keep RelayConnection in HashMap for reuse on reconnect 1347 // 3. Keep RelayConnection in HashMap for reuse on reconnect
1348 // The connection object persists and will be reused when retry_disconnected_relays 1348 // The connection object persists and will be reused when retry_disconnected_relays
1349 // calls try_connect_relay -> connection.connect_and_subscribe() 1349 // calls try_connect_relay -> connection.connect()
1350 tracing::debug!( 1350 tracing::debug!(
1351 relay = %relay_url, 1351 relay = %relay_url,
1352 "Keeping RelayConnection in HashMap for reconnection" 1352 "Keeping RelayConnection in HashMap for reconnection"