chore: add config sleep pause for schedtasks
This commit is contained in:
parent
5b4a4b70b2
commit
5633433f4c
@ -332,6 +332,7 @@ pub async fn main() -> BxDynResult<()> { //std::io::Result<()> {
|
|||||||
eprintln!("Task {} no schedule defined",&it.name);
|
eprintln!("Task {} no schedule defined",&it.name);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
let pause = it.pause;
|
||||||
let res = match it.name.as_str() {
|
let res = match it.name.as_str() {
|
||||||
"monitor" =>
|
"monitor" =>
|
||||||
sched.add(Job::new(&it.schedule.to_owned(), move |uuid, _l| {
|
sched.add(Job::new(&it.schedule.to_owned(), move |uuid, _l| {
|
||||||
@ -353,6 +354,9 @@ pub async fn main() -> BxDynResult<()> { //std::io::Result<()> {
|
|||||||
continue;
|
continue;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
if pause > 0 {
|
||||||
|
tokio::time::sleep(tokio::time::Duration::from_secs(pause)).await;
|
||||||
|
}
|
||||||
match res {
|
match res {
|
||||||
Ok(_) => { continue; },
|
Ok(_) => { continue; },
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user