Skip to content

Commit 6a56353

Browse files
committed
fix: Handles SIGTERM
1 parent d6cf2c8 commit 6a56353

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/signals.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use crate::service::manager::ServicesManager;
21
use crate::service::manager::ServiceMangerConfig;
2+
use crate::service::manager::ServicesManager;
33
use signal_hook::{
4-
consts::{SIGHUP, SIGINT},
4+
consts::{SIGHUP, SIGINT, SIGTERM},
55
iterator::Signals,
66
};
77
use std::process::ExitCode;
@@ -40,7 +40,7 @@ pub fn send_signal(signal: crate::cli::Signal) -> ExitCode {
4040
/// this program?
4141
pub fn handle_sigint(sigint_signal: Arc<tokio::sync::Notify>) {
4242
let mut signals =
43-
Signals::new([SIGINT]).expect("No signals :(. This really should never happen");
43+
Signals::new([SIGINT, SIGTERM]).expect("No signals :(. This really should never happen");
4444

4545
std::thread::spawn(move || {
4646
for _ in signals.forever() {

0 commit comments

Comments
 (0)