diff --git a/src/boot.rs b/src/boot.rs index 8e852f3e6..0d2599ccd 100644 --- a/src/boot.rs +++ b/src/boot.rs @@ -219,7 +219,7 @@ pub async fn run_scheduler( println!("{scheduler}"); Ok(()) } else { - scheduler.run_on_start().await?; + scheduler.run_on_start(); Ok(scheduler.run().await?) } diff --git a/src/scheduler.rs b/src/scheduler.rs index 585395151..1d24778de 100644 --- a/src/scheduler.rs +++ b/src/scheduler.rs @@ -355,7 +355,8 @@ impl Scheduler { Ok(()) } - pub async fn run_on_start(&self) -> Result<()> { + /// Runs every task that is configured to run at start without scheduling them. + pub fn run_on_start(&self) { for job_name in &self.run_on_start { if let Some(job) = self.jobs.get(job_name) { let job_description = @@ -376,8 +377,6 @@ impl Scheduler { tracing::warn!("Job not found in run_on_start: {}", job_name); } } - - Ok(()) } } @@ -588,9 +587,8 @@ mod tests { environment, }; - let result = scheduler.run_on_start().await; + scheduler.run_on_start(); - assert!(result.is_ok()); assert!( std::fs::read_to_string(tree_fs.root.join("scheduler.txt")) .unwrap()