[pbs-devel] [PATCH proxmox-backup v2 2/2] server/worker_task: improve endtime for unknown tasks

Dominik Csapak d.csapak at proxmox.com
Thu Mar 11 09:24:53 CET 2021


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 <d.csapak at proxmox.com>
---
 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<TaskState, Error> {
     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;
-- 
2.20.1






More information about the pbs-devel mailing list