aurelin_framework/scheduling/
commands.rs1use super::{Schedule, TaskOutcome};
4
5pub async fn run(schedule: &Schedule) -> Result<(), CommandError> {
7 let report = schedule.run().await;
8 for task in report.tasks() {
9 if let TaskOutcome::Failed(error) = task.outcome() {
10 eprintln!("scheduled task [{}] failed: {error}", task.name());
11 }
12 }
13 if report.has_failures() { Err(CommandError) } else { Ok(()) }
14}
15
16#[derive(Debug, thiserror::Error)]
18#[error("one or more scheduled tasks failed")]
19pub struct CommandError;