aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/notification-email.rsc10
1 files changed, 8 insertions, 2 deletions
diff --git a/mod/notification-email.rsc b/mod/notification-email.rsc
index 60c1e9b..c474750 100644
--- a/mod/notification-email.rsc
+++ b/mod/notification-email.rsc
@@ -46,9 +46,15 @@
: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 && ($SchedVal->"interval") < 1m) do={
+ :if ([ :len $Scheduler ] < 0) do={
+ /system/scheduler/add name="_FlushEmailQueue" interval=1m start-time=startup \
+ comment="Doing initial checks..." on-event=(":global FlushEmailQueue; \$FlushEmailQueue;");
+ :set Scheduler [ /system/scheduler/find where name="_FlushEmailQueue" ];
+ }
+
+ :local SchedVal [ /system/scheduler/get $Scheduler ];
+ :if (($SchedVal->"interval") < 1m) do={
/system/scheduler/set interval=1m comment="Doing initial checks..." $Scheduler;
}