Rewrite because clippy didn't understand drop
This commit is contained in:
parent
50806b54b7
commit
b14515a422
1 changed files with 23 additions and 21 deletions
|
@ -187,6 +187,7 @@ impl FullMeshPeeringStrategy {
|
||||||
pub async fn run(self: Arc<Self>) {
|
pub async fn run(self: Arc<Self>) {
|
||||||
loop {
|
loop {
|
||||||
// 1. Read current state: get list of connected peers (ping them)
|
// 1. Read current state: get list of connected peers (ping them)
|
||||||
|
let (to_ping, to_retry) = {
|
||||||
let known_hosts = self.known_hosts.read().unwrap();
|
let known_hosts = self.known_hosts.read().unwrap();
|
||||||
debug!("known_hosts: {} peers", known_hosts.list.len());
|
debug!("known_hosts: {} peers", known_hosts.list.len());
|
||||||
|
|
||||||
|
@ -212,7 +213,8 @@ impl FullMeshPeeringStrategy {
|
||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
drop(known_hosts);
|
(to_ping, to_retry)
|
||||||
|
};
|
||||||
|
|
||||||
// 2. Dispatch ping to hosts
|
// 2. Dispatch ping to hosts
|
||||||
trace!("to_ping: {} peers", to_retry.len());
|
trace!("to_ping: {} peers", to_retry.len());
|
||||||
|
|
Loading…
Reference in a new issue