From fa16e797469b81e50867f2f6b0093c6e51229d67 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 3 Mar 2026 18:43:16 +0100 Subject: [PATCH] mod/notification-email: suppress another racy condition --- mod/notification-email.rsc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mod/notification-email.rsc b/mod/notification-email.rsc index da69c0fa..b0ac77ac 100644 --- a/mod/notification-email.rsc +++ b/mod/notification-email.rsc @@ -64,9 +64,14 @@ comment="Doing initial checks..." on-event=(":global FlushEmailQueue; \$FlushEmailQueue;"); } - :if (([ /system/scheduler/get [ find where name="_FlushEmailQueue" ] ]->"interval") < 1m) do={ - /system/scheduler/set interval=1m comment="Doing initial checks..." \ - [ find where name="_FlushEmailQueue" ]; + :do { + :if (([ /system/scheduler/get [ find where name="_FlushEmailQueue" ] ]->"interval") < 1m) do={ + /system/scheduler/set interval=1m comment="Doing initial checks..." \ + [ find where name="_FlushEmailQueue" ]; + } + } on-error={ + $LogPrint debug $0 ("The scheduler is gone, aborting."); + :return false; } :if ([ /tool/e-mail/get last-status ] = "in-progress") do={