public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Stoiko Ivanov <s.ivanov@proxmox.com>, pmg-devel@lists.proxmox.com
Subject: Re: [pmg-devel] [PATCH pmg-api] pmg-daily: avoid short-circuting update of local channels
Date: Wed, 13 Jul 2022 08:58:01 +0200	[thread overview]
Message-ID: <025f66c8-3715-4a26-aea9-240ad82b102f@proxmox.com> (raw)
In-Reply-To: <20220712121428.23851-1-s.ivanov@proxmox.com>

Am 12/07/2022 um 14:14 schrieb Stoiko Ivanov:
> by using ||= directly with the actual update call as operand, it does
> not get run, if `sa-update` already returned that a restart is needed.
> 
> reported in our community forum:
> https://forum.proxmox.com/threads/.112112/
> 
> Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
> ---
>  src/bin/pmg-daily | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/bin/pmg-daily b/src/bin/pmg-daily
> index b06515c..a9bfd1c 100755
> --- a/src/bin/pmg-daily
> +++ b/src/bin/pmg-daily
> @@ -85,7 +85,8 @@ if (system('sa-update') == 0) {
>  }
>  
>  eval {
> -    $restart_filter ||= PMG::Utils::update_local_spamassassin_channels(0);
> +    my $res ||= PMG::Utils::update_local_spamassassin_channels(0);

||= makes not much sense for a newly declared variable, just use plain assignment please.

Alternatively you could also just do:

$restart_filter = 1 if PMG::Utils::update_local_spamassassin_channels(0);
 

> +    $restart_filter ||= $res;
>  };
>  syslog('err', "$@") if $@;
>  





      reply	other threads:[~2022-07-13  6:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-12 12:14 Stoiko Ivanov
2022-07-13  6:58 ` Thomas Lamprecht [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=025f66c8-3715-4a26-aea9-240ad82b102f@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=pmg-devel@lists.proxmox.com \
    --cc=s.ivanov@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