mirror of
https://github.com/postgresml/pgcat.git
synced 2026-03-27 02:36:29 +00:00
Handle SIGTERM. Add docker-compose.yml (#59)
* docker-compsoe * remove statsd config * readme
This commit is contained in:
14
src/main.rs
14
src/main.rs
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user