From ef0ea4ba051dbce58b49deff50e9fa984b6a7de7 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Thu, 11 Mar 2021 09:24:53 +0100 Subject: [PATCH] server/worker_task: improve endtime for unknown tasks instead of always using the starttime, use the last timestamp from the log this way, one can see when the task was aborted without having to read the log Signed-off-by: Dominik Csapak --- src/server/worker_task.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server/worker_task.rs b/src/server/worker_task.rs index 1e8e009f..6c5456c9 100644 --- a/src/server/worker_task.rs +++ b/src/server/worker_task.rs @@ -207,6 +207,8 @@ pub fn upid_read_status(upid: &UPID) -> Result { let mut iter = last_line.splitn(2, ": "); if let Some(time_str) = iter.next() { if let Ok(endtime) = proxmox::tools::time::parse_rfc3339(time_str) { + // set the endtime even if we cannot parse the state + status = TaskState::Unknown { endtime }; if let Some(rest) = iter.next().and_then(|rest| rest.strip_prefix("TASK ")) { if let Ok(state) = TaskState::from_endtime_and_message(endtime, rest) { status = state;