From: Arik Sosman Date: Wed, 6 Sep 2023 23:26:59 +0000 (-0700) Subject: Always wait 10 seconds prior to attempting reconnection. X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=42f64e6208fb2e91d9d5012b5662e3b65721367f;p=rapid-gossip-sync-server Always wait 10 seconds prior to attempting reconnection. --- diff --git a/src/tracking.rs b/src/tracking.rs index d25b60a..2f1e3b3 100644 --- a/src/tracking.rs +++ b/src/tracking.rs @@ -181,15 +181,16 @@ async fn connect_peer(current_peer: (P sender.send(true).await.unwrap(); } disconnection_future.await; - log_warn!(logger, "Disconnected from peer {}@{}...", current_peer.0.to_hex(), current_peer.1.to_string()); - tokio::time::sleep(Duration::from_secs(10)).await; - log_warn!(logger, "Reconnecting to peer {}@{}...", current_peer.0.to_hex(), current_peer.1.to_string()); + log_warn!(logger, "Disconnected from peer {}@{}", current_peer.0.to_hex(), current_peer.1.to_string()); } else { + log_warn!(logger, "Failed to connect to peer {}@{}!", current_peer.0.to_hex(), current_peer.1.to_string()); if is_first_iteration { sender.send(false).await.unwrap(); } } is_first_iteration = false; + tokio::time::sleep(Duration::from_secs(10)).await; + log_warn!(logger, "Reconnecting to peer {}@{}...", current_peer.0.to_hex(), current_peer.1.to_string()); } });