1
1
mirror of https://github.com/ellie/atuin.git synced 2024-09-21 01:47:34 +03:00

fix: fixes unix specific impl of shutdown_signal (#1061)

This commit is contained in:
YummyOreo 2023-06-19 02:14:03 -05:00 committed by GitHub
parent b8b57c86af
commit 85c7339e65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,6 +14,7 @@ mod utils;
pub use settings::Settings;
use tokio::signal;
#[cfg(target_family = "unix")]
async fn shutdown_signal() {
signal::unix::signal(signal::unix::SignalKind::terminate())
.expect("failed to register signal handler")
@ -22,6 +23,15 @@ async fn shutdown_signal() {
eprintln!("Shutting down gracefully...");
}
#[cfg(target_family = "windows")]
async fn shutdown_signal() {
signal::windows::ctrl_c()
.expect("failed to register signal handler")
.recv()
.await;
eprintln!("Shutting down gracefully...");
}
pub async fn launch<Db: Database>(
settings: Settings<Db::Settings>,
host: String,