conditional start
This commit is contained in:
parent
2f5911fd35
commit
c3da356bc7
@ -955,9 +955,11 @@ pub async fn process_control(
|
||||
}
|
||||
}
|
||||
ProcessCtl::Start => {
|
||||
if !manager.is_alive.load(Ordering::SeqCst) {
|
||||
manager.channel.lock().unwrap().active = true;
|
||||
manager.async_start().await;
|
||||
}
|
||||
}
|
||||
ProcessCtl::Stop => {
|
||||
manager.channel.lock().unwrap().active = false;
|
||||
manager.async_stop().await;
|
||||
@ -965,9 +967,12 @@ pub async fn process_control(
|
||||
ProcessCtl::Restart => {
|
||||
manager.async_stop().await;
|
||||
tokio::time::sleep(tokio::time::Duration::from_millis(1500)).await;
|
||||
|
||||
if !manager.is_alive.load(Ordering::SeqCst) {
|
||||
manager.async_start().await;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(web::Json("Success"))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user