Watch
0
0
Fork
You've already forked hyperhive
0

hive-c0re: wait on the shared shutdown_signal

This commit is contained in:
atlas 2026-11-18 03:28:12 +01:00 • committed by mara
commit 4c8be5400d

View file

@ -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();
}
}