public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Gabriel Goller" <g.goller@proxmox.com>
To: "Proxmox Backup Server development discussion"
	<pbs-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup v3] api: make prune-group a real workertask
Date: Tue, 12 Mar 2024 14:07:27 +0100	[thread overview]
Message-ID: <CZRSMABGTBRA.PLTG35RS57W4@proxmox.com> (raw)
In-Reply-To: <87a5n32143.fsf@gmail.com>

On Tue Mar 12, 2024 at 11:30 AM CET, Stefan Lendl wrote:
>
> LGTM with a slight note below for a style preference.
>
> > +    let prune_group = move |worker: Arc<WorkerTask>| {
> > +        if keep_all {
> > +            task_log!(worker, "No prune selection - keeping all files.");
> > +        } else {
>
> You don't actually need to spawn a task if you're not doing any work.
> On the other hand it makes the code slightly simpler and you need the
> worker, right?

IMO starting a worker is better, because the user sees that something is
happening... I mean we could also immediately return and show a popup in
the frontend, but that won't work when the user isn't logged
in/currently looking at the page. This way he simply sees a prune job in
the task log which prints 'No prune selection - keeping all files'.

> > [snip]
> > -    for (info, mark) in prune_info {
> > -        let keep = keep_all || mark.keep();
>
> > +        for (info, mark) in prune_info {
> > +            let keep = keep_all || mark.keep();
> > +            let backup_dir = &info.backup_dir;
>
> You wouldn't have to handle keep_all here.
>
> You're handling dry_run separatly already as well.

Hmm I think I need it here though, note that this is not inside the
if/else statement above. Even if we have keep_all we still want to go
through all the snapshots and mark them (+ output mark) I guess.

Thanks for the review!





  reply	other threads:[~2024-03-12 13:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08 13:36 Gabriel Goller
2024-03-12 10:30 ` Stefan Lendl
2024-03-12 13:07   ` Gabriel Goller [this message]
2024-04-02 11:14     ` Stefan Lendl
2024-04-09  9:04 ` Gabriel Goller
2024-04-09 10:44 ` [pbs-devel] applied: " 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=CZRSMABGTBRA.PLTG35RS57W4@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