From 10900e7740891d145f023988fd31fd89eca2ba10 Mon Sep 17 00:00:00 2001 From: cloudwithax Date: Sat, 14 Feb 2026 15:57:42 -0500 Subject: [PATCH] increase ping interval to 30s and idle connection timeout to 300s --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index d1aa04a..9b4d0cc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -93,10 +93,11 @@ async fn main() -> Result<(), Box> { "/dusk/relay/1.0.0".to_string(), key.public(), )), - ping: ping::Behaviour::default(), + // ping every 30s to keep peer connections alive + ping: ping::Behaviour::new(ping::Config::new().with_interval(Duration::from_secs(30))), } })? - .with_swarm_config(|cfg| cfg.with_idle_connection_timeout(Duration::from_secs(120))) + .with_swarm_config(|cfg| cfg.with_idle_connection_timeout(Duration::from_secs(300))) .build(); // listen on all interfaces