better unfinished log

This commit is contained in:
Pascal Engélibert 2025-12-19 16:02:53 +01:00
commit 13ce9f1891

View file

@ -157,6 +157,7 @@ pub async fn play(
Ok(v) => v.unwrap().unwrap(), Ok(v) => v.unwrap().unwrap(),
Err(_e) => { Err(_e) => {
// TODO fix // TODO fix
println!("client timeout {id}");
break 'repeat; break 'repeat;
} }
}; };
@ -279,6 +280,7 @@ pub async fn play(
Ok(v) => v.unwrap().unwrap(), Ok(v) => v.unwrap().unwrap(),
Err(_e) => { Err(_e) => {
// TODO fix // TODO fix
println!("client timeout {id}");
break 'repeat; break 'repeat;
} }
}; };
@ -309,7 +311,9 @@ pub async fn play(
} }
} }
} }
tokio::spawn(async move { tokio::spawn({
let running = running.clone();
async move {
let mut last_count = 0; let mut last_count = 0;
loop { loop {
tokio::time::sleep(std::time::Duration::from_secs(2)).await; tokio::time::sleep(std::time::Duration::from_secs(2)).await;
@ -321,9 +325,11 @@ pub async fn play(
} }
last_count = new_count; last_count = new_count;
} }
}
}); });
for handle in handles { for handle in handles {
handle.await.unwrap(); handle.await.unwrap();
} }
println!("Unfinished: {:?}", running.lock().await);
std::process::exit(0); std::process::exit(0);
} }