fix: simple subflow approval step triggering timeouts

This commit is contained in:
Ruben Fiszel
2024-05-31 12:50:29 +02:00
parent 9308e2a63c
commit be160f6e46
2 changed files with 5 additions and 12 deletions
+2 -12
View File
@@ -276,8 +276,9 @@ impl FlowModule {
}
pub fn is_simple(&self) -> bool {
//todo: flow modules could also be simple execpt for the fact that the case of having single parallel flow approval step is not handled well (Create SuspendedTimeout)
self.get_type()
.is_ok_and(|x| x == "flow" || x == "script" || x == "rawscript")
.is_ok_and(|x| x == "script" || x == "rawscript")
}
pub fn get_type(&self) -> anyhow::Result<String> {
@@ -531,17 +532,6 @@ impl Into<Box<serde_json::value::RawValue>> for FlowModuleValue {
}
}
impl FlowModuleValue {
pub fn is_simple(&self) -> bool {
match self {
FlowModuleValue::Script { .. } => true,
FlowModuleValue::Flow { .. } => true,
FlowModuleValue::RawScript { .. } => true,
_ => false,
}
}
}
fn ordered_map<S>(value: &HashMap<String, InputTransform>, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
@@ -139,12 +139,15 @@
$retryStatus[jobId ?? ''] = count
} else if ($retryStatus[jobId ?? ''] != undefined) {
delete $retryStatus[jobId ?? '']
$retryStatus = $retryStatus
}
let jobStatus = job?.flow_status?.modules?.[job?.flow_status.step]
if (jobStatus && jobStatus.count != undefined) {
$suspendStatus[jobId ?? ''] = { nb: jobStatus.count, job: job! }
} else if ($suspendStatus[jobId ?? ''] != undefined) {
delete $suspendStatus[jobId ?? '']
$suspendStatus = $suspendStatus
}
}