Skip to content

Commit

Permalink
Use self.config.idle_timeout in Kademlia handler (#1635)
Browse files Browse the repository at this point in the history
tomaka authored Jun 30, 2020
1 parent 823c747 commit 9049591
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions protocols/kad/src/handler.rs
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 9049591

Please sign in to comment.