Skip to content

Commit 9cf3d5c

Browse files
committed
only 1 timeout message
1 parent dbb7e62 commit 9cf3d5c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/auto_splitting/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,7 @@ async fn watchdog(
840840
interrupt_receiver: watch::Receiver<Option<InterruptHandle>>,
841841
) {
842842
const TIMEOUT: Duration = Duration::from_secs(5);
843+
let mut has_timed_out = false;
843844

844845
loop {
845846
let instant = *timeout_receiver.borrow();
@@ -854,7 +855,10 @@ async fn watchdog(
854855
Ok(Err(_)) => return,
855856
Err(_) => {
856857
if let Some(handle) = &*interrupt_receiver.borrow() {
857-
log::error!(target: "Auto Splitter", "timeout, no update in {} seconds", TIMEOUT.as_secs_f32());
858+
if !has_timed_out {
859+
log::error!(target: "Auto Splitter", "timeout, no update in {} seconds", TIMEOUT.as_secs_f32());
860+
has_timed_out = true;
861+
}
858862
handle.interrupt();
859863
}
860864
}

0 commit comments

Comments
 (0)