Use core::future::pending
instead of tokio's ^C
This commit is contained in:
parent
97ef8caa17
commit
c9ba61be3b
@ -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(())
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user