Better child killing
This commit is contained in:
parent
a31db191e8
commit
d2efbe92ca
3
data.rs
3
data.rs
|
@ -1,5 +1,6 @@
|
||||||
use std::{process::Child, sync::{Arc, Mutex}};
|
use std::{sync::{Arc, Mutex}};
|
||||||
use lazy_static::lazy_static;
|
use lazy_static::lazy_static;
|
||||||
|
use tokio::process::Child;
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use hyper::http::HeaderValue;
|
use hyper::http::HeaderValue;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use std::{process::{Command, Stdio, Child}, time::{Duration, SystemTime, UNIX_EPOCH}, path::Path, io::Error, thread};
|
use std::{process::Stdio, time::{Duration, SystemTime, UNIX_EPOCH}, path::Path, io::Error, thread};
|
||||||
use tokio::{time::sleep, fs};
|
use tokio::{process::{Command, Child}, time::sleep, fs};
|
||||||
|
|
||||||
use crate::{data::{SERVICES, ServiceData}, conf::{ProxyConf, CONFIG}};
|
use crate::{data::{SERVICES, ServiceData}, conf::{ProxyConf, CONFIG}};
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ fn stop_service(index: usize) {
|
||||||
modify_service_data(index, |s| {
|
modify_service_data(index, |s| {
|
||||||
match s.child.as_mut() {
|
match s.child.as_mut() {
|
||||||
Some(c) => {
|
Some(c) => {
|
||||||
c.kill().unwrap();
|
c.start_kill().unwrap();
|
||||||
},
|
},
|
||||||
None => {}
|
None => {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue