From 3240eb156c1642aeeec895749c5e95c8f33ed069 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Fri, 2 Aug 2024 16:37:17 +0200 Subject: [PATCH] fix: fix run_flow_async from call --- backend/windmill-worker/src/worker_flow.rs | 30 ++++++++++++---------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/backend/windmill-worker/src/worker_flow.rs b/backend/windmill-worker/src/worker_flow.rs index b839405b89..b81f7324bb 100644 --- a/backend/windmill-worker/src/worker_flow.rs +++ b/backend/windmill-worker/src/worker_flow.rs @@ -952,21 +952,23 @@ pub async fn update_flow_status_after_job_completion_internal< let _ = tokio::fs::remove_dir_all(format!("{worker_dir}/{}", flow_job.id)).await; } - if let Some(parent_job) = flow_job.parent_job { - tracing::info!(subflow_id = %flow_job.id, parent_id = %parent_job, "subflow is finished, updating parent flow status"); + if flow_job.is_flow_step { + if let Some(parent_job) = flow_job.parent_job { + tracing::info!(subflow_id = %flow_job.id, parent_id = %parent_job, "subflow is finished, updating parent flow status"); - return Ok(Some(RecUpdateFlowStatusAfterJobCompletion { - flow: parent_job, - job_id_for_status: flow, - success: success && !is_failure_step, - result: nresult.clone(), - stop_early_override: if stop_early { - Some(skip_if_stop_early) - } else { - None - }, - skip_error_handler: skip_error_handler || is_failure_step, - })); + return Ok(Some(RecUpdateFlowStatusAfterJobCompletion { + flow: parent_job, + job_id_for_status: flow, + success: success && !is_failure_step, + result: nresult.clone(), + stop_early_override: if stop_early { + Some(skip_if_stop_early) + } else { + None + }, + skip_error_handler: skip_error_handler || is_failure_step, + })); + } } Ok(None) } else {