mirror of
https://github.com/aljazceru/goose.git
synced 2026-02-23 07:24:24 +01:00
fix: move process group termination instead unix code block (#2481)
Co-authored-by: Alice Hau <ahau@squareup.com>
This commit is contained in:
@@ -59,13 +59,14 @@ pub async fn run_server(name: &str) -> Result<()> {
|
||||
_ = shutdown.notified() => {
|
||||
// On Unix systems, kill the entire process group
|
||||
#[cfg(unix)]
|
||||
fn terminate_process_group() {
|
||||
let pgid = getpgrp();
|
||||
kill(Pid::from_raw(-pgid.as_raw()), Signal::SIGTERM)
|
||||
.expect("Failed to send SIGTERM to process group");
|
||||
{
|
||||
fn terminate_process_group() {
|
||||
let pgid = getpgrp();
|
||||
kill(Pid::from_raw(-pgid.as_raw()), Signal::SIGTERM)
|
||||
.expect("Failed to send SIGTERM to process group");
|
||||
}
|
||||
terminate_process_group();
|
||||
}
|
||||
terminate_process_group();
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user