More logging when ending main

This commit is contained in:
asonix 2022-11-19 21:51:04 -06:00
parent 8d0d39b1fc
commit 9272ba0d4c

View file

@ -94,6 +94,12 @@ fn init_subscriber(
#[actix_rt::main] #[actix_rt::main]
async fn main() -> Result<(), anyhow::Error> { 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(); dotenv::dotenv().ok();
let config = Config::build()?; let config = Config::build()?;
@ -222,8 +228,12 @@ async fn main() -> Result<(), anyhow::Error> {
.run() .run()
.await?; .await?;
tracing::warn!("Server closed");
drop(manager); drop(manager);
tracing::warn!("Main complete");
Ok(()) Ok(())
} }