diff --git a/veza-chat-server/src/main.rs b/veza-chat-server/src/main.rs index 192d7e0c5..88faaddd5 100644 --- a/veza-chat-server/src/main.rs +++ b/veza-chat-server/src/main.rs @@ -304,6 +304,7 @@ async fn main() -> Result<(), ChatError> { info!(" - GET /ws - WebSocket Chat (🆕)"); axum::serve(listener, app) + .with_graceful_shutdown(shutdown_signal()) .await .map_err(|e| ChatError::configuration_error(&format!("Server error: {e}")))?; @@ -447,3 +448,30 @@ async fn get_stats(State(_state): State) -> Json(); + + tokio::select! { + _ = ctrl_c => {}, + _ = terminate => {}, + } + + info!("🛑 Signal d'arrêt reçu, fermeture gracieuse..."); +}