From ecea507670c9ed4aa6696bd6cc8d5761119c417b Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Wed, 14 Aug 2024 14:34:53 +0200 Subject: [PATCH] all --- backend/windmill-common/src/flows.rs | 6 ++++++ backend/windmill-worker/src/worker_flow.rs | 3 +++ openflow.openapi.yaml | 2 ++ 3 files changed, 11 insertions(+) diff --git a/backend/windmill-common/src/flows.rs b/backend/windmill-common/src/flows.rs index ea27fa7422..dbc44afdd9 100644 --- a/backend/windmill-common/src/flows.rs +++ b/backend/windmill-common/src/flows.rs @@ -213,6 +213,12 @@ pub struct Suspend { pub self_approval_disabled: Option, #[serde(skip_serializing_if = "Option::is_none")] pub hide_cancel: Option, + #[serde(skip_serializing_if = "false_or_empty")] + pub continue_on_disapprove_timeout: Option, +} + +fn false_or_empty(v: &Option) -> bool { + v.is_none() || v.as_ref().is_some_and(|x| !x) } #[derive(Deserialize, Serialize, Debug, Clone)] diff --git a/backend/windmill-worker/src/worker_flow.rs b/backend/windmill-worker/src/worker_flow.rs index b81f7324bb..771595ab77 100644 --- a/backend/windmill-worker/src/worker_flow.rs +++ b/backend/windmill-worker/src/worker_flow.rs @@ -760,6 +760,7 @@ pub async fn update_flow_status_after_job_completion_internal< // tracing::error!( // "UPDATE FLOW STATUS 3: {module:#?} {unrecoverable} {} {is_last_step} {success} {skip_error_handler}", flow_job.canceled // ); + let should_continue_flow = match success { _ if stop_early => false, _ if flow_job.canceled => false, @@ -1749,6 +1750,8 @@ async fn push_next_flow_job tx.commit().await?; /* not enough messages to do this job, "park"/suspend until there are */ + } else if suspend.continue_on_disapprove_timeout.unwrap_or(false) { + todo!() } else if matches!( &status_module, FlowStatusModule::WaitingForPriorSteps { .. } diff --git a/openflow.openapi.yaml b/openflow.openapi.yaml index 7b4c132de0..317877fdcd 100644 --- a/openflow.openapi.yaml +++ b/openflow.openapi.yaml @@ -139,6 +139,8 @@ components: type: boolean hide_cancel: type: boolean + continue_on_disapprove_timeout: + type: boolean priority: type: number continue_on_error: