From 9049591d46bdf520b038f9e7138554acd625e3a8 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Tue, 30 Jun 2020 07:50:45 +0200 Subject: [PATCH] Use self.config.idle_timeout in Kademlia handler (#1635) --- protocols/kad/src/handler.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protocols/kad/src/handler.rs b/protocols/kad/src/handler.rs index 57f3c55b02b..8c08e90ef09 100644 --- a/protocols/kad/src/handler.rs +++ b/protocols/kad/src/handler.rs @@ -632,7 +632,7 @@ where } (None, Some(event), _) => { if self.substreams.is_empty() { - self.keep_alive = KeepAlive::Until(Instant::now() + Duration::from_secs(10)); + self.keep_alive = KeepAlive::Until(Instant::now() + self.config.idle_timeout); } return Poll::Ready(event); } @@ -653,7 +653,7 @@ where if self.substreams.is_empty() { // We destroyed all substreams in this function. - self.keep_alive = KeepAlive::Until(Instant::now() + Duration::from_secs(10)); + self.keep_alive = KeepAlive::Until(Instant::now() + self.config.idle_timeout); } else { self.keep_alive = KeepAlive::Yes; }