fix: prevent premature Windows client shutdown due to empty/closed console event streams

This commit is contained in:
ospab 2026-05-17 01:30:00 +03:00
parent ff207112d8
commit bfa858ff93
1 changed files with 15 additions and 3 deletions

View File

@ -25,9 +25,21 @@ pub async fn wait_for_shutdown_signal() -> Result<()> {
let mut c_break = ctrl_break()?;
tokio::select! {
_ = c_c.recv() => {}
_ = c_close.recv() => {}
_ = c_break.recv() => {}
res = c_c.recv() => {
if res.is_none() {
std::future::pending::<()>().await;
}
}
res = c_close.recv() => {
if res.is_none() {
std::future::pending::<()>().await;
}
}
res = c_break.recv() => {
if res.is_none() {
std::future::pending::<()>().await;
}
}
}
}
#[cfg(not(target_os = "windows"))]