Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
6f04d0cdda
commit
eeaf59ac63
@ -16,19 +16,15 @@ impl ScheduledTasks {
|
||||
) -> anyhow::Result<()> {
|
||||
tracing::info!("scheduling: {}", task);
|
||||
|
||||
// Get plan
|
||||
let plan = Plan::new();
|
||||
let tasks = plan.tasks().await?;
|
||||
|
||||
// For task
|
||||
for task in tasks {
|
||||
// Check idempotency rules
|
||||
if !task.should_run().await? {
|
||||
tracing::debug!(task = task.id(), "skipping run");
|
||||
continue;
|
||||
}
|
||||
|
||||
// Run task if not valid
|
||||
tracing::info!(task = task.id(), "executing task");
|
||||
task.execute().await?;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user