From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [PATCH proxmox-backup 1/2] api: node: return optional endtime in tasks status
Date: Thu, 30 Apr 2026 14:10:14 +0200 [thread overview]
Message-ID: <20260430121015.528664-2-c.ebner@proxmox.com> (raw)
In-Reply-To: <20260430121015.528664-1-c.ebner@proxmox.com>
With the intention to correctly show the task end time without
relying on further API calls or workarounds to gather it.
Whenever the task is considered finished, return the endtime
according to the parsed TaskState.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
src/api2/node/tasks.rs | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/api2/node/tasks.rs b/src/api2/node/tasks.rs
index fe619a08e..838f874d0 100644
--- a/src/api2/node/tasks.rs
+++ b/src/api2/node/tasks.rs
@@ -255,6 +255,11 @@ fn into_task_list_item(info: proxmox_rest_server::TaskListInfo) -> pbs_api_types
optional: true,
description: "'OK', 'Error: <msg>', or 'unknown'.",
},
+ endtime: {
+ type: i64,
+ description: "The task end time (Epoch)",
+ optional: true,
+ },
},
},
access: {
@@ -292,6 +297,7 @@ async fn get_task_status(param: Value, rpcenv: &mut dyn RpcEnvironment) -> Resul
let exitstatus = upid_read_status(&upid).unwrap_or(TaskState::Unknown { endtime: 0 });
result["status"] = Value::from("stopped");
result["exitstatus"] = Value::from(exitstatus.to_string());
+ result["endtime"] = Value::from(exitstatus.endtime());
};
Ok(result)
--
2.47.3
next prev parent reply other threads:[~2026-04-30 12:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-30 12:10 [PATCH proxmox-backup 0/2] additional task endtime fixes Christian Ebner
2026-04-30 12:10 ` Christian Ebner [this message]
2026-04-30 12:10 ` [PATCH proxmox-backup 2/2] ui: GC/prune: pass tasks last run endtime to task viewer Christian Ebner
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=20260430121015.528664-2-c.ebner@proxmox.com \
--to=c.ebner@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.