Skip to content

Commit eb8e80a

Browse files
committed
box flowmodulestatus to reduce stack allocation of flowvalue
1 parent 98b65ed commit eb8e80a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

backend/windmill-common/src/flow_status.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub fn is_retry_default(v: &RetryStatus) -> bool {
2929
pub struct FlowStatus {
3030
pub step: i32,
3131
pub modules: Vec<FlowStatusModule>,
32-
pub failure_module: FlowStatusModuleWParent,
32+
pub failure_module: Box<FlowStatusModuleWParent>,
3333

3434
#[serde(skip_serializing_if = "HashMap::is_empty")]
3535
#[serde(default)]
@@ -227,7 +227,7 @@ impl FlowStatus {
227227
.iter()
228228
.map(|m| FlowStatusModule::WaitingForPriorSteps { id: m.id.clone() })
229229
.collect(),
230-
failure_module: FlowStatusModuleWParent {
230+
failure_module: Box::new(FlowStatusModuleWParent {
231231
parent_module: None,
232232
module_status: FlowStatusModule::WaitingForPriorSteps {
233233
id: f
@@ -236,7 +236,7 @@ impl FlowStatus {
236236
.map(|x| x.id.clone())
237237
.unwrap_or_else(|| "failure".to_string()),
238238
},
239-
},
239+
}),
240240
cleanup_module: FlowCleanupModule { flow_jobs_to_clean: vec![] },
241241
retry: RetryStatus { fail_count: 0, failed_jobs: vec![] },
242242
restarted_from: None,

backend/windmill-queue/src/jobs.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2969,12 +2969,12 @@ pub async fn push<'c, T: Serialize + Send + Sync, R: rsmq_async::RsmqConnection
29692969
step: step_n,
29702970
modules: truncated_modules,
29712971
// failure_module is reset
2972-
failure_module: FlowStatusModuleWParent {
2972+
failure_module: Box::new(FlowStatusModuleWParent {
29732973
parent_module: None,
29742974
module_status: FlowStatusModule::WaitingForPriorSteps {
29752975
id: "failure".to_string(),
29762976
},
2977-
},
2977+
}),
29782978
cleanup_module,
29792979
// retry status is reset
29802980
retry: RetryStatus { fail_count: 0, failed_jobs: vec![] },
@@ -3124,12 +3124,12 @@ pub async fn push<'c, T: Serialize + Send + Sync, R: rsmq_async::RsmqConnection
31243124
step: step_n,
31253125
modules: truncated_modules,
31263126
// failure_module is reset
3127-
failure_module: FlowStatusModuleWParent {
3127+
failure_module: Box::new(FlowStatusModuleWParent {
31283128
parent_module: None,
31293129
module_status: FlowStatusModule::WaitingForPriorSteps {
31303130
id: "failure".to_string(),
31313131
},
3132-
},
3132+
}),
31333133
cleanup_module,
31343134
// retry status is reset
31353135
retry: RetryStatus { fail_count: 0, failed_jobs: vec![] },

0 commit comments

Comments
 (0)