hive-c0re: wait on the shared shutdown_signal
This commit is contained in:
parent
a8775f1a7a
commit
4c8be5400d
1 changed files with 1 additions and 11 deletions
|
|
@ -385,17 +385,7 @@ async fn cmd_serve(
|
|||
let coord_sig = coord.clone();
|
||||
tokio::select! {
|
||||
res = server::serve(socket, coord) => { res? }
|
||||
_ = tokio::signal::ctrl_c() => {
|
||||
tracing::info!("SIGINT received — requesting shutdown");
|
||||
coord_sig.request_shutdown();
|
||||
}
|
||||
() = async {
|
||||
let mut sig = tokio::signal::unix::signal(
|
||||
tokio::signal::unix::SignalKind::terminate()
|
||||
).expect("failed to install SIGTERM handler");
|
||||
sig.recv().await;
|
||||
} => {
|
||||
tracing::info!("SIGTERM received — requesting shutdown");
|
||||
() = swarm_secret_client::shutdown_signal() => {
|
||||
coord_sig.request_shutdown();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue