A bit finer grained timeout interval in get_peers loop
This commit is contained in:
parent
b3ab2c4d4c
commit
21b1bd9e7d
1 changed files with 4 additions and 2 deletions
|
|
@ -287,7 +287,7 @@ impl RecursiveRequest<RecursiveRequestCallbacksGetPeers> {
|
||||||
trace!("iteration {}", iteration);
|
trace!("iteration {}", iteration);
|
||||||
let sleep = match this.get_peers_root() {
|
let sleep = match this.get_peers_root() {
|
||||||
Ok(0) => Duration::from_secs(1),
|
Ok(0) => Duration::from_secs(1),
|
||||||
Ok(n) if n < 8 => REQUERY_INTERVAL / 2,
|
Ok(n) if n < 8 => REQUERY_INTERVAL / 8 * (n as u32),
|
||||||
Ok(_) => REQUERY_INTERVAL,
|
Ok(_) => REQUERY_INTERVAL,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
error!("error in get_peers_root(): {e:?}");
|
error!("error in get_peers_root(): {e:?}");
|
||||||
|
|
@ -313,7 +313,9 @@ impl RecursiveRequest<RecursiveRequestCallbacksGetPeers> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Some(_) = futs.next(), if !futs.is_empty() => {}
|
Some(_) = futs.next(), if !futs.is_empty() => {}
|
||||||
_ = &mut looper => {}
|
r = &mut looper => {
|
||||||
|
return r
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue