Handle SIGTERM. Add docker-compose.yml (#59)

* docker-compsoe

* remove statsd config

* readme
This commit is contained in:
Lev Kokotov
2022-03-08 17:18:48 -08:00
committed by GitHub
parent 341ebf4123
commit b309ead58f
8 changed files with 139 additions and 24 deletions

View File

@@ -205,16 +205,14 @@ async fn main() {
}
});
// Setup shut down sequence
match signal::ctrl_c().await {
Ok(()) => {
info!("Shutting down...");
}
let mut term_signal = unix_signal(SignalKind::terminate()).unwrap();
Err(err) => {
error!("Unable to listen for shutdown signal: {}", err);
}
tokio::select! {
_ = signal::ctrl_c() => (),
_ = term_signal.recv() => (),
};
info!("Shutting down...");
}
/// Format chrono::Duration to be more human-friendly.