mod/notification-email: suppress another racy condition

This commit is contained in:
Christian Hesse 2026-03-03 18:43:16 +01:00
parent 2567c332de
commit fa16e79746

View file

@ -64,10 +64,15 @@
comment="Doing initial checks..." on-event=(":global FlushEmailQueue; \$FlushEmailQueue;"); comment="Doing initial checks..." on-event=(":global FlushEmailQueue; \$FlushEmailQueue;");
} }
:do {
:if (([ /system/scheduler/get [ find where name="_FlushEmailQueue" ] ]->"interval") < 1m) do={ :if (([ /system/scheduler/get [ find where name="_FlushEmailQueue" ] ]->"interval") < 1m) do={
/system/scheduler/set interval=1m comment="Doing initial checks..." \ /system/scheduler/set interval=1m comment="Doing initial checks..." \
[ find where name="_FlushEmailQueue" ]; [ 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={ :if ([ /tool/e-mail/get last-status ] = "in-progress") do={
$LogPrint debug $0 ("Sending mail is currently in progress, not flushing."); $LogPrint debug $0 ("Sending mail is currently in progress, not flushing.");