diff --git a/src/main.rs b/src/main.rs index f1df875..fd57680 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,6 +13,7 @@ use chrono::Local; use actix_web::{middleware::Logger, web, App, HttpServer}; use serde::{Deserialize, Serialize}; use sqlx::{PgPool, Pool, Postgres, Connection}; +use tokio::signal::unix::SignalKind; use utoipa::{OpenApi, openapi::security::{SecurityScheme, ApiKey, ApiKeyValue}, Modify}; use utoipa_swagger_ui::{Config, SwaggerUi, Url}; @@ -249,8 +250,8 @@ async fn main() { let watchdog_thread = tokio::spawn(async move { postgres_watchdog(pool_copy, shutdown_clone).await }); tokio::spawn(async move { - actix_web::rt::signal::ctrl_c().await.unwrap(); - println!("Ctrl-C received, killing Server"); + actix_web::rt::signal::unix::signal(SignalKind::interrupt()).unwrap().recv().await; + println!("SIGINT received, killing Server"); abort() });