diff --git a/src/main.rs b/src/main.rs index 62823fc..3e96a82 100644 --- a/src/main.rs +++ b/src/main.rs @@ -85,20 +85,21 @@ async fn shutdown_signal() { }; #[cfg(unix)] - let terminate = async { - signal::unix::signal(signal::unix::SignalKind::terminate()) - .expect("failed to install signal handler") - .recv() - .await; - }; + { + let terminate = async { + signal::unix::signal(signal::unix::SignalKind::terminate()) + .expect("failed to install signal handler") + .recv() + .await; + }; + tokio::select! { + () = ctrl_c => {} + () = terminate => {} + } + } #[cfg(not(unix))] - let terminate = std::future::pending::<()>(); - - tokio::select! { - () = ctrl_c => {}, - () = terminate => {}, - } + ctrl_c.await; } fn app(state: AppState) -> Router {