From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 1E6ED1FF13C for ; Thu, 30 Apr 2026 14:10:35 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id EE5D542E0; Thu, 30 Apr 2026 14:10:34 +0200 (CEST) From: Christian Ebner 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 Message-ID: <20260430121015.528664-2-c.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260430121015.528664-1-c.ebner@proxmox.com> References: <20260430121015.528664-1-c.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1777550930062 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.070 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: E75XITOQLGVPZFJ72UINFXMGYKEYNMXU X-Message-ID-Hash: E75XITOQLGVPZFJ72UINFXMGYKEYNMXU X-MailFrom: c.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- 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: ', 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