From 9272ba0d4c5d7f9c565b1da9f997ba2a7050ea74 Mon Sep 17 00:00:00 2001 From: asonix Date: Sat, 19 Nov 2022 21:51:04 -0600 Subject: [PATCH] More logging when ending main --- src/main.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main.rs b/src/main.rs index 0b309e2..bedd4b9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -94,6 +94,12 @@ fn init_subscriber( #[actix_rt::main] async fn main() -> Result<(), anyhow::Error> { + actix_rt::spawn(do_main()).await??; + tracing::warn!("Application exit"); + Ok(()) +} + +async fn do_main() -> Result<(), anyhow::Error> { dotenv::dotenv().ok(); let config = Config::build()?; @@ -222,8 +228,12 @@ async fn main() -> Result<(), anyhow::Error> { .run() .await?; + tracing::warn!("Server closed"); + drop(manager); + tracing::warn!("Main complete"); + Ok(()) }