From 7e13bf4fb6c0b0a579332fc49b5108a94b881663 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Wed, 1 Oct 2025 15:35:07 +0000 Subject: [PATCH] fix: fix job duration unwrap crash --- backend/windmill-worker/src/result_processor.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/windmill-worker/src/result_processor.rs b/backend/windmill-worker/src/result_processor.rs index 5bd3dd1753..3b0645ef06 100644 --- a/backend/windmill-worker/src/result_processor.rs +++ b/backend/windmill-worker/src/result_processor.rs @@ -691,10 +691,10 @@ pub async fn process_completed_job( &job.workspace_id, false, Arc::new(serde_json::value::to_raw_value(&result).unwrap()), - duration.map(|x| FlowJobDuration { - started_at: job.started_at.unwrap(), - duration_ms: x, - }), + duration.and_then(|d| job.started_at.map(|started_at| FlowJobDuration { + started_at: started_at, + duration_ms: d, + })), false, &same_worker_tx.expect(SAME_WORKER_REQUIREMENTS).to_owned(), &worker_dir,