mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-20 00:02:19 +00:00
box flowmodule to reduce stack allocation of flowvalue
This commit is contained in:
@@ -955,7 +955,7 @@ mod tests {
|
||||
continue_on_error: None,
|
||||
},
|
||||
],
|
||||
failure_module: Some(FlowModule {
|
||||
failure_module: Some(Box::new(FlowModule {
|
||||
id: "d".to_string(),
|
||||
value: FlowModuleValue::Script {
|
||||
path: "test".to_string(),
|
||||
@@ -977,7 +977,7 @@ mod tests {
|
||||
priority: None,
|
||||
delete_after_use: None,
|
||||
continue_on_error: None,
|
||||
}),
|
||||
})),
|
||||
same_worker: false,
|
||||
concurrent_limit: None,
|
||||
concurrency_time_window_s: None,
|
||||
|
||||
@@ -87,7 +87,7 @@ pub struct FlowValue {
|
||||
pub modules: Vec<FlowModule>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
#[serde(default)]
|
||||
pub failure_module: Option<FlowModule>,
|
||||
pub failure_module: Option<Box<FlowModule>>,
|
||||
#[serde(default)]
|
||||
#[serde(skip_serializing_if = "is_default")]
|
||||
pub same_worker: bool,
|
||||
|
||||
@@ -931,7 +931,7 @@ fn get_module(flow_job: &QueuedJob, module_index: Option<usize>) -> Option<FlowM
|
||||
if let Some(module) = raw_flow.modules.get(i) {
|
||||
Some(module.clone())
|
||||
} else {
|
||||
raw_flow.failure_module
|
||||
raw_flow.failure_module.map(|x| *x.clone())
|
||||
}
|
||||
} else {
|
||||
None
|
||||
@@ -1674,7 +1674,7 @@ async fn push_next_flow_job<R: rsmq_async::RsmqConnection + Send + Sync + Clone>
|
||||
let mut module: &FlowModule = flow
|
||||
.modules
|
||||
.get(i)
|
||||
.or_else(|| flow.failure_module.as_ref())
|
||||
.or_else(|| flow.failure_module.as_deref())
|
||||
.with_context(|| format!("no module at index {}", status.step))?;
|
||||
|
||||
let current_id = &module.id;
|
||||
|
||||
Reference in New Issue
Block a user