increase ping interval to 30s and idle connection timeout to 300s

This commit is contained in:
cloudwithax 2026-02-14 15:57:42 -05:00
parent db66dc2bed
commit 10900e7740
1 changed files with 3 additions and 2 deletions

View File

@ -93,10 +93,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
"/dusk/relay/1.0.0".to_string(), "/dusk/relay/1.0.0".to_string(),
key.public(), 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(); .build();
// listen on all interfaces // listen on all interfaces