1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-05-19 01:53:56 +00:00

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 committed by Daniel García
parent 4f1928778a
commit 50c46f6e9a
No known key found for this signature in database
GPG key ID: FC8A7D14C3CD543A
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?;