mirror of https://github.com/ospab/ostp.git
fix: prevent premature Windows client shutdown due to empty/closed console event streams
This commit is contained in:
parent
ff207112d8
commit
bfa858ff93
|
|
@ -25,9 +25,21 @@ pub async fn wait_for_shutdown_signal() -> Result<()> {
|
||||||
let mut c_break = ctrl_break()?;
|
let mut c_break = ctrl_break()?;
|
||||||
|
|
||||||
tokio::select! {
|
tokio::select! {
|
||||||
_ = c_c.recv() => {}
|
res = c_c.recv() => {
|
||||||
_ = c_close.recv() => {}
|
if res.is_none() {
|
||||||
_ = c_break.recv() => {}
|
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"))]
|
#[cfg(not(target_os = "windows"))]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue