[pmg-devel] [PATCH pmg-api v2] pmg-daily: avoid short-circuting update of local channels

Stoiko Ivanov s.ivanov at proxmox.com
Wed Jul 13 11:09:35 CEST 2022


by using ||= directly with the actual update call, 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 at proxmox.com>
---
v1->v2:
* dropped the temporary variable in favor of a post-if (more in line
  with our remaining code - and actually prettier imho) - thx at Thomas
  for the suggestion!
 src/bin/pmg-daily | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/pmg-daily b/src/bin/pmg-daily
index b06515c..d67a88a 100755
--- a/src/bin/pmg-daily
+++ b/src/bin/pmg-daily
@@ -85,7 +85,7 @@ if (system('sa-update') == 0) {
 }
 
 eval {
-    $restart_filter ||= PMG::Utils::update_local_spamassassin_channels(0);
+    $restart_filter = 1 if PMG::Utils::update_local_spamassassin_channels(0);
 };
 syslog('err', "$@") if $@;
 
-- 
2.30.2





More information about the pmg-devel mailing list