Avoid overflow of interval
This commit is contained in:
parent
9e0fd6b11a
commit
30b160fe53
1 changed files with 1 additions and 1 deletions
|
@ -25,7 +25,7 @@ pub(super) async fn propagate_read(
|
|||
|
||||
// We do our own pin_mut! to avoid shadowing timeout and be able to reset it, on next loop iteration
|
||||
// We reuse the future to avoid creating a timer in the tight loop
|
||||
let frequency = ping_frequency.unwrap_or(Duration::from_secs(u64::MAX));
|
||||
let frequency = ping_frequency.unwrap_or(Duration::from_secs(3600 * 24));
|
||||
let start_at = Instant::now().checked_add(frequency).unwrap_or(Instant::now());
|
||||
let timeout = tokio::time::interval_at(start_at, frequency);
|
||||
pin_mut!(timeout);
|
||||
|
|
Loading…
Reference in a new issue