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