conditional start

This commit is contained in:
Jonathan Baecker 2024-09-30 18:15:17 +02:00
parent 2f5911fd35
commit c3da356bc7

View File

@ -955,8 +955,10 @@ pub async fn process_control(
}
}
ProcessCtl::Start => {
manager.channel.lock().unwrap().active = true;
manager.async_start().await;
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;
@ -965,7 +967,10 @@ pub async fn process_control(
ProcessCtl::Restart => {
manager.async_stop().await;
tokio::time::sleep(tokio::time::Duration::from_millis(1500)).await;
manager.async_start().await;
if !manager.is_alive.load(Ordering::SeqCst) {
manager.async_start().await;
}
}
}