From 4438a1049844dffd140ef18eb389e872f1bfe7c4 Mon Sep 17 00:00:00 2001 From: Alexis Sellier Date: Thu, 23 Mar 2023 12:11:17 +0100 Subject: [PATCH] node: Change ping interval to 1 minute 30 seconds is too chatty. --- radicle-node/src/service.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/radicle-node/src/service.rs b/radicle-node/src/service.rs index 257b1a79..69b47ad7 100644 --- a/radicle-node/src/service.rs +++ b/radicle-node/src/service.rs @@ -62,9 +62,9 @@ pub const SYNC_INTERVAL: LocalDuration = LocalDuration::from_secs(60); /// How often to run the "prune" task. pub const PRUNE_INTERVAL: LocalDuration = LocalDuration::from_mins(30); /// Duration to wait on an unresponsive peer before dropping its connection. -pub const STALE_CONNECTION_TIMEOUT: LocalDuration = LocalDuration::from_secs(60); +pub const STALE_CONNECTION_TIMEOUT: LocalDuration = LocalDuration::from_mins(1); /// How much time should pass after a peer was last active for a *ping* to be sent. -pub const KEEP_ALIVE_DELTA: LocalDuration = LocalDuration::from_secs(30); +pub const KEEP_ALIVE_DELTA: LocalDuration = LocalDuration::from_mins(1); /// Maximum time difference between the local time, and an announcement timestamp. pub const MAX_TIME_DELTA: LocalDuration = LocalDuration::from_mins(60); /// Maximum attempts to connect to a peer before we give up. @@ -1397,7 +1397,7 @@ where let stale = self .sessions .connected() - .filter(|(_, session)| session.last_active < *now - STALE_CONNECTION_TIMEOUT); + .filter(|(_, session)| *now - session.last_active >= STALE_CONNECTION_TIMEOUT); for (_, session) in stale { self.reactor.disconnect(