From d3a4072488f38a41f66400ebeef3e21ebfeccff3 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Thu, 2 Nov 2023 08:32:45 +0100 Subject: [PATCH] deactive forloop pruning in-presence of sleep or suspend --- backend/windmill-worker/src/worker_flow.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/windmill-worker/src/worker_flow.rs b/backend/windmill-worker/src/worker_flow.rs index cec3d50650..af4a035773 100644 --- a/backend/windmill-worker/src/worker_flow.rs +++ b/backend/windmill-worker/src/worker_flow.rs @@ -2107,8 +2107,11 @@ async fn compute_next_flow_transform( /* forloop modules are expected set `iter: { value: Value, index: usize }` as job arguments */ FlowModuleValue::ForloopFlow { modules, iterator, parallel, .. } => { // if it's a simple single step flow, we will collapse it as an optimization and need to pass flow_input as an arg - let is_simple = - modules.len() == 1 && modules[0].value.is_simple() && flow.failure_module.is_none(); + let is_simple = modules.len() == 1 + && modules[0].value.is_simple() + && modules[0].sleep.is_none() + && modules[0].suspend.is_none() + && flow.failure_module.is_none(); let next_loop_status = match status_module { FlowStatusModule::WaitingForPriorSteps { .. }