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 837B41FF136 for ; Mon, 23 Mar 2026 17:54:42 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id C1AE932C9C; Mon, 23 Mar 2026 17:54:59 +0100 (CET) Date: Mon, 23 Mar 2026 17:54:53 +0100 From: Arthur Bied-Charreton To: Lukas Wagner Subject: Re: [PATCH pve-cluster 1/1] notifications: Add refresh_targets subroutine to PVE::Notify Message-ID: References: <20260213160415.609868-1-a.bied-charreton@proxmox.com> <20260213160415.609868-17-a.bied-charreton@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1774284848386 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.817 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. 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: FSRGQW5MI2AWV5VS5ENUROQ57ONOSUSH X-Message-ID-Hash: FSRGQW5MI2AWV5VS5ENUROQ57ONOSUSH X-MailFrom: a.bied-charreton@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 CC: pve-devel@lists.proxmox.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Mon, Mar 23, 2026 at 01:26:34PM +0100, Lukas Wagner wrote: > On Fri Feb 13, 2026 at 5:04 PM CET, Arthur Bied-Charreton wrote: > > Expose API to allow refreshing all notification targets' state from the > > PVE backend, as well as from pveupdate. > > > > Signed-off-by: Arthur Bied-Charreton > > --- > > src/PVE/Notify.pm | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/src/PVE/Notify.pm b/src/PVE/Notify.pm > > index b44b5b3..ebb2311 100644 > > --- a/src/PVE/Notify.pm > > +++ b/src/PVE/Notify.pm > > @@ -103,6 +103,12 @@ sub error { > > ); > > } > > > > +sub trigger_state_refresh { > > + my ($config) = @_; > > + $config = read_config() if !defined($config); > > + $config->trigger_state_refresh(); > > +} > > + > > maybe I'm missing something, but it does not seem like you actually > need/use this function? > No, this is a remnant of a different approach I took in the beginning, sorry about that - will be gone in v2 > As far as I could tell you always call into the perlmod-bidings directly > in the API handler as well as `pveupdate` and do not call this wrapper > here? > > Calling this helper here would be a > > PVE::Notify::trigger_state_refresh(); > > but you always do a > > my $config = PVE::Notify::read_config(); > $config->trigger_state_refresh(); > > > I think both variants would be OK, but you should either remove this > patch here or actually use it at the call sites :) >