From 6166c4d7aae9eddcee92f950959b9d2290bc917a Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Tue, 28 May 2024 10:48:13 +0200 Subject: [PATCH] fix: fix retry not working on single step flow due to opt --- backend/windmill-worker/src/worker_flow.rs | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/backend/windmill-worker/src/worker_flow.rs b/backend/windmill-worker/src/worker_flow.rs index 4499334b2c..8c674fe57b 100644 --- a/backend/windmill-worker/src/worker_flow.rs +++ b/backend/windmill-worker/src/worker_flow.rs @@ -536,7 +536,9 @@ pub async fn update_flow_status_after_job_completion_internal< .fetch_optional(&mut tx) .await .map_err(|e| { - Error::InternalErr(format!("error while getting retry from step: {e:#}")) + Error::InternalErr(format!( + "error while getting retry from step: {e:#}" + )) })? .flatten(); @@ -986,7 +988,11 @@ async fn compute_skip_branchall_failure<'c>( .fetch_one(db) .await .map(|(v,)| v) - .map_err(|e| Error::InternalErr(format!("error during retrieval of skip_loop_failures: {e:#}"))) + .map_err(|e| { + Error::InternalErr(format!( + "error during retrieval of skip_loop_failures: {e:#}" + )) + }) } async fn has_failure_module<'c>( @@ -1001,7 +1007,11 @@ async fn has_failure_module<'c>( .bind(flow) .fetch_one(&mut **tx) .await - .map_err(|e| Error::InternalErr(format!("error during retrieval of has_failure_module: {e:#}"))) + .map_err(|e| { + Error::InternalErr(format!( + "error during retrieval of has_failure_module: {e:#}" + )) + }) .map(|v| v.unwrap_or(false)) } @@ -2151,8 +2161,9 @@ async fn push_next_flow_job } if payload_tag.delete_after_use { - let uuid_singleton_json = serde_json::to_value(&[uuid]) - .map_err(|e| error::Error::InternalErr(format!("Unable to serialize uuid: {e:#}")))?; + let uuid_singleton_json = serde_json::to_value(&[uuid]).map_err(|e| { + error::Error::InternalErr(format!("Unable to serialize uuid: {e:#}")) + })?; sqlx::query( "UPDATE queue @@ -2950,6 +2961,7 @@ fn is_simple_modules(modules: &Vec, flow: &FlowValue) -> bool { && modules[0].sleep.is_none() && modules[0].suspend.is_none() && modules[0].cache_ttl.is_none() + && modules[0].retry.is_none() && modules[0].stop_after_if.is_none() && (modules[0].mock.is_none() || modules[0].mock.as_ref().is_some_and(|m| !m.enabled)) && flow.failure_module.is_none();