use `MissedTickBehavior::Skip` on all intervals

main
_ 2021-07-18 17:40:07 +00:00
parent d8c6e1bd14
commit 3a2147d50f
2 changed files with 3 additions and 0 deletions

View File

@ -490,6 +490,7 @@ async fn handle_endless_source (gib: usize, throttle: Option <usize>)
};
let mut interval = tokio::time::interval (Duration::from_millis (1000));
interval.set_missed_tick_behavior (tokio::time::MissedTickBehavior::Skip);
let mut blocks_sent = 0;
while blocks_sent < num_blocks {
@ -771,6 +772,7 @@ pub async fn run_relay (
let state_2 = state.clone ();
tokio::spawn (async move {
let mut reload_interval = tokio::time::interval (Duration::from_secs (60));
reload_interval.set_missed_tick_behavior (tokio::time::MissedTickBehavior::Skip);
loop {
reload_interval.tick ().await;

View File

@ -106,6 +106,7 @@ impl Interval {
}
let mut interval = tokio::time::interval (Duration::from_secs (60));
interval.set_missed_tick_behavior (tokio::time::MissedTickBehavior::Skip);
let mut counter = 0_u64;