better unfinished log
This commit is contained in:
parent
b9c9c4a4a7
commit
13ce9f1891
1 changed files with 16 additions and 10 deletions
|
|
@ -157,6 +157,7 @@ pub async fn play(
|
|||
Ok(v) => v.unwrap().unwrap(),
|
||||
Err(_e) => {
|
||||
// TODO fix
|
||||
println!("client timeout {id}");
|
||||
break 'repeat;
|
||||
}
|
||||
};
|
||||
|
|
@ -279,6 +280,7 @@ pub async fn play(
|
|||
Ok(v) => v.unwrap().unwrap(),
|
||||
Err(_e) => {
|
||||
// TODO fix
|
||||
println!("client timeout {id}");
|
||||
break 'repeat;
|
||||
}
|
||||
};
|
||||
|
|
@ -309,21 +311,25 @@ pub async fn play(
|
|||
}
|
||||
}
|
||||
}
|
||||
tokio::spawn(async move {
|
||||
let mut last_count = 0;
|
||||
loop {
|
||||
tokio::time::sleep(std::time::Duration::from_secs(2)).await;
|
||||
println!("Running: {:?}", running.lock().await);
|
||||
let new_count = counter.load(std::sync::atomic::Ordering::Relaxed);
|
||||
if new_count == last_count {
|
||||
println!("Stalled at {} / {}, stopping", new_count, total);
|
||||
std::process::exit(0);
|
||||
tokio::spawn({
|
||||
let running = running.clone();
|
||||
async move {
|
||||
let mut last_count = 0;
|
||||
loop {
|
||||
tokio::time::sleep(std::time::Duration::from_secs(2)).await;
|
||||
println!("Running: {:?}", running.lock().await);
|
||||
let new_count = counter.load(std::sync::atomic::Ordering::Relaxed);
|
||||
if new_count == last_count {
|
||||
println!("Stalled at {} / {}, stopping", new_count, total);
|
||||
std::process::exit(0);
|
||||
}
|
||||
last_count = new_count;
|
||||
}
|
||||
last_count = new_count;
|
||||
}
|
||||
});
|
||||
for handle in handles {
|
||||
handle.await.unwrap();
|
||||
}
|
||||
println!("Unfinished: {:?}", running.lock().await);
|
||||
std::process::exit(0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue