diff --git a/src/app.rs b/src/app.rs index e67fa44..48514d5 100755 --- a/src/app.rs +++ b/src/app.rs @@ -596,6 +596,23 @@ where let service_handles = join_all(services); + let crons: Vec> = self + .cronjobs + .iter() + .map(|(tid, task)| { + info!("Starting Task with ID: {}", tid); + // TODO: Recovery should be here. + nuclei::spawn(async move { + match task.start().await { + Ok(dep) => dep.await, + _ => panic!("Error occurred on start of Task with ID: {}.", tid), + } + }) + }) + .collect(); + + let cron_handles = join_all(crons); + let tasks: Vec> = self .tasks .iter()