+bug : strange delay

pull/9/head
prplV 2024-07-03 10:30:16 -04:00
parent 38a9f39c60
commit d30f1e044f
2 changed files with 24 additions and 4 deletions

View File

@ -22,5 +22,25 @@
} }
}] }]
} }
}] },
{
"name" : "temp-process",
"path" : "/home/vladislav/web/temp-process",
"dependencies" : {
"files" : [
{
"filename" : "control-file",
"src" : "/home/vladislav/web/"
}],
"services" : [{
"hostname" : "ya.ru",
"port" : 443,
"triggers" : {
"wait" : 200,
"delay" : 3
}
}]
}
}
]
} }

View File

@ -121,7 +121,7 @@ async fn run_daemons(
_ = serv_hand => {}, _ = serv_hand => {},
_ = rx.recv() => { _ = rx.recv() => {
terminate_process(&proc.name).await; terminate_process(&proc.name).await;
println!("Process stopped due to error with dependency handling"); println!("Dependency handling error: Terminating {} process ..." , &proc.name);
}, },
} }
} }
@ -188,7 +188,7 @@ async fn file_handler(name: &str, files: &Vec<Files>, tx: mpsc::Sender<usize>) {
} }
match check_file(&file.filename, &file.src) { match check_file(&file.filename, &file.src) {
Ok(_) => { Ok(_) => {
println!("{} is still in directory!", &file.filename); // println!("{} is still in directory!", &file.filename);
}, },
Err(_) => { Err(_) => {
tx.send(1).await.unwrap(); tx.send(1).await.unwrap();
@ -216,7 +216,7 @@ async fn service_handler(name: &str, services: &Vec<Services>, tx: mpsc::Sender<
} }
match check_service(&serv.hostname, &serv.port) { match check_service(&serv.hostname, &serv.port) {
Ok(_) => { Ok(_) => {
println!("{} is up!", &serv.hostname); // println!("{} is up!", &serv.hostname);
}, },
Err(_) => { Err(_) => {
tx.send(1).await.unwrap(); tx.send(1).await.unwrap();