diff --git a/data.rs b/data.rs index 04d2d9c..a25739c 100755 --- a/data.rs +++ b/data.rs @@ -1,5 +1,6 @@ -use std::{process::Child, sync::{Arc, Mutex}}; +use std::{sync::{Arc, Mutex}}; use lazy_static::lazy_static; +use tokio::process::Child; use std::collections::HashMap; use hyper::http::HeaderValue; diff --git a/services.rs b/services.rs index 4ede123..6f046ae 100755 --- a/services.rs +++ b/services.rs @@ -1,5 +1,5 @@ -use std::{process::{Command, Stdio, Child}, time::{Duration, SystemTime, UNIX_EPOCH}, path::Path, io::Error, thread}; -use tokio::{time::sleep, fs}; +use std::{process::Stdio, time::{Duration, SystemTime, UNIX_EPOCH}, path::Path, io::Error, thread}; +use tokio::{process::{Command, Child}, time::sleep, fs}; use crate::{data::{SERVICES, ServiceData}, conf::{ProxyConf, CONFIG}}; @@ -77,7 +77,7 @@ fn stop_service(index: usize) { modify_service_data(index, |s| { match s.child.as_mut() { Some(c) => { - c.kill().unwrap(); + c.start_kill().unwrap(); }, None => {} }