public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Gabriel Goller <g.goller@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 1/1] prune: add upid to workertask log_result function
Date: Wed,  3 Sep 2025 16:13:47 +0200	[thread overview]
Message-ID: <20250903141349.268228-4-g.goller@proxmox.com> (raw)
In-Reply-To: <20250903141349.268228-1-g.goller@proxmox.com>

The prune job builds the workertask from scratch (when no `use-task`
option is pased) so we need to pass the upid and print the starting
message manually.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
---
 src/api2/admin/datastore.rs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs
index a098aca8e114..3de28d2c6204 100644
--- a/src/api2/admin/datastore.rs
+++ b/src/api2/admin/datastore.rs
@@ -1002,8 +1002,10 @@ pub fn prune(
         let (worker, logger) =
             WorkerTask::new("prune", Some(worker_id), auth_id.to_string(), true)?;
         let result = LogContext::new(logger).sync_scope(|| {
+            let upid = worker.upid().to_string();
+            worker.log_start(&upid, "prune");
             let result = prune_group(worker.clone());
-            worker.log_result(&Ok(()));
+            worker.log_result(&Ok(()), &upid);
             result
         });
         Ok(json!(result))
-- 
2.47.2



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


      parent reply	other threads:[~2025-09-03 14:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-03 14:13 [pbs-devel] [PATCH proxmox{, -backup} 0/3] Always print workertask start and end logs to syslog Gabriel Goller
2025-09-03 14:13 ` [pbs-devel] [PATCH proxmox 1/2] worker_task: always print the result message to the syslog Gabriel Goller
2025-09-03 14:13 ` [pbs-devel] [PATCH proxmox 2/2] worker_task: print worker starting message and upid Gabriel Goller
2025-09-03 14:13 ` Gabriel Goller [this message]

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=20250903141349.268228-4-g.goller@proxmox.com \
    --to=g.goller@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal