Remove ctrlc crate and some updates

- Removed ctrlc crate and use the tokio provided ctrl_c function.
- Updated some crates.
This commit is contained in:
BlackDex
2022-12-10 17:51:05 +01:00
parent b7c9a346c1
commit cebe0f6442
3 changed files with 68 additions and 93 deletions

View File

@ -454,11 +454,12 @@ async fn launch_rocket(pool: db::DbPool, extra_debug: bool) -> Result<(), Error>
.await?;
CONFIG.set_rocket_shutdown_handle(instance.shutdown());
ctrlc::set_handler(move || {
tokio::spawn(async move {
tokio::signal::ctrl_c().await.expect("Error setting Ctrl-C handler");
info!("Exiting vaultwarden!");
CONFIG.shutdown();
})
.expect("Error setting Ctrl-C handler");
});
let _ = instance.launch().await?;