summaryrefslogtreecommitdiff
path: root/makima/src/orchestration/directive.rs
diff options
context:
space:
mode:
Diffstat (limited to 'makima/src/orchestration/directive.rs')
-rw-r--r--makima/src/orchestration/directive.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/makima/src/orchestration/directive.rs b/makima/src/orchestration/directive.rs
index 92aacde..9113fd4 100644
--- a/makima/src/orchestration/directive.rs
+++ b/makima/src/orchestration/directive.rs
@@ -382,6 +382,17 @@ impl DirectiveOrchestrator {
repository::assign_orchestrator_task(&self.pool, directive_id, task.id).await?;
+ // Cancel any old planning tasks for this directive (superseded by the new one)
+ let cancelled =
+ repository::cancel_old_planning_tasks(&self.pool, directive_id, task.id).await?;
+ if cancelled > 0 {
+ tracing::info!(
+ directive_id = %directive_id,
+ cancelled_count = cancelled,
+ "Cancelled old planning tasks superseded by new plan"
+ );
+ }
+
// Try to dispatch to a daemon
self.try_dispatch_task(task.id, owner_id, &task.name, &task.plan, task.version).await;