From eff8570f591fe32a6106087807e3fe8c18e8e5e4 Mon Sep 17 00:00:00 2001 From: mpostma Date: Wed, 3 Mar 2021 15:10:00 +0100 Subject: [PATCH] handle ctrl-c shutdown --- src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index c9042b88e..c5e2d11e6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -112,7 +112,9 @@ async fn run_http(data: Data, opt: Opt, enable_frontend: bool) -> Result<(), Box .wrap(middleware::Logger::default()) .wrap(middleware::Compress::default()) .wrap(middleware::NormalizePath::new(TrailingSlash::Trim)) - }); + }) + // Disable signals allows the server to terminate immediately when a user enter CTRL-C + .disable_signals(); if let Some(config) = opt.get_ssl_config()? { http_server