From 0588ce1642988e2a5138a2648d5c3e2f575fe905 Mon Sep 17 00:00:00 2001 From: Samuel Pastva Date: Tue, 22 Oct 2024 09:07:01 +0200 Subject: [PATCH] Fix elapsed time computation. --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index d7764ea..bbdf275 100644 --- a/src/main.rs +++ b/src/main.rs @@ -964,7 +964,7 @@ async fn get_control_computation_status() -> BackendResponse { if let Some(computation) = &*cmp { let elapsed = computation .finished_timestamp - .unwrap() // Should be present if results are computed. + .unwrap_or_else(|| SystemTime::now()) .duration_since(computation.timestamp) .unwrap(); let elapsed = u64::try_from(elapsed.as_millis()).unwrap_or(u64::MAX);