cancelling actions works now
This commit is contained in:
@@ -52,10 +52,14 @@ pub struct ExecutionResponse {
|
||||
#[schema(example = 1)]
|
||||
pub enforcement: Option<i64>,
|
||||
|
||||
/// Executor ID (worker/executor that ran this)
|
||||
/// Identity ID that initiated this execution
|
||||
#[schema(example = 1)]
|
||||
pub executor: Option<i64>,
|
||||
|
||||
/// Worker ID currently assigned to this execution
|
||||
#[schema(example = 1)]
|
||||
pub worker: Option<i64>,
|
||||
|
||||
/// Execution status
|
||||
#[schema(example = "succeeded")]
|
||||
pub status: ExecutionStatus,
|
||||
@@ -216,6 +220,7 @@ impl From<attune_common::models::execution::Execution> for ExecutionResponse {
|
||||
parent: execution.parent,
|
||||
enforcement: execution.enforcement,
|
||||
executor: execution.executor,
|
||||
worker: execution.worker,
|
||||
status: execution.status,
|
||||
result: execution
|
||||
.result
|
||||
|
||||
@@ -123,6 +123,7 @@ pub async fn create_execution(
|
||||
parent: None,
|
||||
enforcement: None,
|
||||
executor: None,
|
||||
worker: None,
|
||||
status: ExecutionStatus::Requested,
|
||||
result: None,
|
||||
workflow_task: None, // Non-workflow execution
|
||||
@@ -510,11 +511,11 @@ pub async fn cancel_execution(
|
||||
.await;
|
||||
|
||||
// Send cancel request to the worker via MQ
|
||||
if let Some(worker_id) = execution.executor {
|
||||
if let Some(worker_id) = execution.worker {
|
||||
send_cancel_to_worker(publisher.as_deref(), id, worker_id).await;
|
||||
} else {
|
||||
tracing::warn!(
|
||||
"Execution {} has no executor/worker assigned; marked as canceling but no MQ message sent",
|
||||
"Execution {} has no worker assigned; marked as canceling but no MQ message sent",
|
||||
id
|
||||
);
|
||||
}
|
||||
@@ -754,7 +755,7 @@ async fn cancel_workflow_children_with_policy(
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(worker_id) = child.executor {
|
||||
if let Some(worker_id) = child.worker {
|
||||
send_cancel_to_worker(publisher, child_id, worker_id).await;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user