Skip to content

Commit d318c76

Browse files
committed
timeout message
1 parent 5e48065 commit d318c76

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/auto_splitting/mod.rs

Lines changed: 5 additions & 0 deletions
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,6 +855,10 @@ async fn watchdog(
854855
Ok(Err(_)) => return,
855856
Err(_) => {
856857
if let Some(handle) = &*interrupt_receiver.borrow() {
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+
}
857862
handle.interrupt();
858863
}
859864
}

0 commit comments

Comments
 (0)