all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 2/2] server/worker_task: improve endtime for unknown tasks
Date: Thu, 11 Mar 2021 08:29:30 +0100	[thread overview]
Message-ID: <20210311072930.4805-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20210311072930.4805-1-d.csapak@proxmox.com>

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@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





  reply	other threads:[~2021-03-11  7:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-11  7:29 [pbs-devel] [PATCH proxmox-backup 1/2] tape/send_load_media_email: reuse send_job_status_mail Dominik Csapak
2021-03-11  7:29 ` Dominik Csapak [this message]
2021-03-11  8:09 ` Thomas Lamprecht
2021-03-11  8:14   ` Dominik Csapak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210311072930.4805-2-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal