better peer minimum refresh

This commit is contained in:
John Smith
2023-07-19 12:32:03 -04:00
parent f7a6f094ee
commit 9d0479fc45
2 changed files with 18 additions and 14 deletions
+5 -11
View File
@@ -698,16 +698,7 @@ impl BucketEntryInner {
pub(super) fn needs_ping(&self, cur_ts: Timestamp) -> bool {
// See which ping pattern we are to use
let state = self.state(cur_ts);
// If we don't have node status for this node, then we should ping it to get some node status
for routing_domain in RoutingDomainSet::all() {
if self.has_node_info(routing_domain.into()) {
if self.node_status(routing_domain).is_none() {
return true;
}
}
}
match state {
BucketEntryState::Reliable => {
// If we are in a reliable state, we need a ping on an exponential scale
@@ -742,7 +733,10 @@ impl BucketEntryInner {
// If we are in an unreliable state, we need a ping every UNRELIABLE_PING_INTERVAL_SECS seconds
self.needs_constant_ping(cur_ts, TimestampDuration::new(UNRELIABLE_PING_INTERVAL_SECS as u64 * 1000000u64))
}
BucketEntryState::Dead => false,
BucketEntryState::Dead => {
error!("Should not be asking this for dead nodes");
false
}
}
}