mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-28 09:11:34 +00:00
Use self.config.idle_timeout in Kademlia handler (#1635)
This commit is contained in:
@ -632,7 +632,7 @@ where
|
|||||||
}
|
}
|
||||||
(None, Some(event), _) => {
|
(None, Some(event), _) => {
|
||||||
if self.substreams.is_empty() {
|
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);
|
return Poll::Ready(event);
|
||||||
}
|
}
|
||||||
@ -653,7 +653,7 @@ where
|
|||||||
|
|
||||||
if self.substreams.is_empty() {
|
if self.substreams.is_empty() {
|
||||||
// We destroyed all substreams in this function.
|
// 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 {
|
} else {
|
||||||
self.keep_alive = KeepAlive::Yes;
|
self.keep_alive = KeepAlive::Yes;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user