From 3f92edb5c1a5415de5e9ebfd4a5139cb687d3956 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 15 Sep 2022 21:56:31 +0200 Subject: global-functions: $FlushEmailQueue: use $0 for scheduler name --- global-functions | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/global-functions b/global-functions index 8d8ac1c..7c8bfdc 100644 --- a/global-functions +++ b/global-functions @@ -340,11 +340,11 @@ :return false; } - :if ([ :len [ /system/scheduler/find where name="FlushEmailQueue" ] ] > 0 && $QueueLen = 0) do={ + :if ([ :len [ /system/scheduler/find where name=$0 ] ] > 0 && $QueueLen = 0) do={ $LogPrintExit2 warning $0 ("Flushing E-Mail messages from scheduler, but queue is empty.") false; } - /system/scheduler/set interval=($QueueLen . "m") [ find where name="FlushEmailQueue" ]; + /system/scheduler/set interval=($QueueLen . "m") [ find where name=$0 ]; :foreach Id,Message in=$EmailQueue do={ :if ([ :typeof $Message ] = "array" ) do={ @@ -374,10 +374,10 @@ } :if ($AllDone = true && $QueueLen = [ :len $EmailQueue ]) do={ - /system/scheduler/remove [ find where name="FlushEmailQueue" ]; + /system/scheduler/remove [ find where name=$0 ]; :set EmailQueue; } else={ - /system/scheduler/set interval=1m [ find where name="FlushEmailQueue" ]; + /system/scheduler/set interval=1m [ find where name=$0 ]; } } @@ -634,8 +634,8 @@ [ $IfThenElse ([ :len ($Notification->"link") ] > 0) ("\n\n" . ($Notification->"link")) "" ] . \ [ $IfThenElse ([ :len $Signature ] > 0) ("\n-- \n" . $Signature) "" ]); \ attach=($Notification->"attach"); remove-attach=($Notification->"remove-attach") }; - :if ([ :len [ /system/scheduler/find where name="FlushEmailQueue" ] ] = 0) do={ - /system/scheduler/add name=FlushEmailQueue interval=1s start-time=startup \ + :if ([ :len [ /system/scheduler/find where name="\$FlushEmailQueue" ] ] = 0) do={ + /system/scheduler/add name="\$FlushEmailQueue" interval=1s start-time=startup \ on-event=(":global FlushEmailQueue; \$FlushEmailQueue;"); } } -- cgit v1.2.3-54-g00ecf