From 42bcc63d29c85a7fcdb175b3ea725654d2db7039 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 10 Dec 2024 17:12:24 +0100 Subject: mod/notification-email: increase retry interval on failure --- mod/notification-email.rsc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/notification-email.rsc b/mod/notification-email.rsc index dd90923..b109bf4 100644 --- a/mod/notification-email.rsc +++ b/mod/notification-email.rsc @@ -46,8 +46,9 @@ :local AllDone true; :local QueueLen [ :len $EmailQueue ]; :local Scheduler [ /system/scheduler/find where name="_FlushEmailQueue" ]; + :local SchedVal [ /system/scheduler/get $Scheduler ]; - :if ([ :len $Scheduler ] > 0 && [ /system/scheduler/get $Scheduler interval ] < 1m) do={ + :if ([ :len $Scheduler ] > 0 && ($SchedVal->"interval") < 1m) do={ /system/scheduler/set interval=1m comment="Doing initial checks..." $Scheduler; } @@ -111,7 +112,8 @@ /system/scheduler/remove $Scheduler; :set EmailQueue; } else={ - /system/scheduler/set interval=1m comment="Waiting for retry..." $Scheduler; + /system/scheduler/set interval=(($SchedVal->"run-count") . "m") \ + comment="Waiting for retry..." $Scheduler; } } on-error={ :global ExitError; $ExitError false $0; -- cgit v1.2.3-70-g09d2