Skip to content

Commit 979acaa

Browse files
committed
timeout message
1 parent fff8df0 commit 979acaa

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
@@ -862,6 +862,7 @@ async fn watchdog(
862862
interrupt_receiver: watch::Receiver<Option<InterruptHandle>>,
863863
) {
864864
const TIMEOUT: Duration = Duration::from_secs(5);
865+
let mut has_timed_out = false;
865866

866867
loop {
867868
let instant = *timeout_receiver.borrow();
@@ -876,6 +877,10 @@ async fn watchdog(
876877
Ok(Err(_)) => return,
877878
Err(_) => {
878879
if let Some(handle) = &*interrupt_receiver.borrow() {
880+
if !has_timed_out {
881+
log::error!(target: "Auto Splitter", "timeout, no update in {} seconds", TIMEOUT.as_secs_f32());
882+
has_timed_out = true;
883+
}
879884
handle.interrupt();
880885
}
881886
}

0 commit comments

Comments
 (0)