Use core::future::pending instead of tokio's ^C

This commit is contained in:
Elias Schriefer 2020-12-06 16:49:38 +01:00
parent 97ef8caa17
commit c9ba61be3b

View File

@ -121,11 +121,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
true true
})); }));
// Will (afaik) be stabilized in Rust 1.48 // Has been stabilized in Rust 1.48
// core::future::pending::<()>().await; core::future::pending::<()>().await;
unreachable!();
// Wait until SIGTERM (when systemd stops this service), then shutdown
tokio::signal::unix::signal(tokio::signal::unix::SignalKind::terminate())?.recv().await;
info!("Got SIGTERM, shutting down");
Ok(())
} }