From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup v2 2/2] server/worker_task: improve endtime for unknown tasks
Date: Thu, 11 Mar 2021 09:24:53 +0100 [thread overview]
Message-ID: <20210311082453.17920-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20210311082453.17920-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
next prev parent reply other threads:[~2021-03-11 8:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-11 8:24 [pbs-devel] [PATCH proxmox-backup v2 1/2] tape/send_load_media_email: move to server/email_notifications Dominik Csapak
2021-03-11 8:24 ` Dominik Csapak [this message]
2021-03-11 8:58 ` [pbs-devel] applied: [PATCH proxmox-backup v2 2/2] server/worker_task: improve endtime for unknown tasks Thomas Lamprecht
2021-03-11 8:58 ` [pbs-devel] applied: [PATCH proxmox-backup v2 1/2] tape/send_load_media_email: move to server/email_notifications Thomas Lamprecht
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=20210311082453.17920-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox