From 47e4f292cba0059f55eb7e3aec1ca0d237ecf4b3 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 15 Sep 2022 21:59:06 +0200 Subject: mod/notification-telegram: $FlushTelegramQueue: use $0 for scheduler name --- mod/notification-telegram | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mod/notification-telegram') diff --git a/mod/notification-telegram b/mod/notification-telegram index 8c4cd65..849740b 100644 --- a/mod/notification-telegram +++ b/mod/notification-telegram @@ -23,7 +23,7 @@ :local AllDone true; :local QueueLen [ :len $TelegramQueue ]; - :if ([ :len [ /system/scheduler/find where name="FlushTelegramQueue" ] ] > 0 && $QueueLen = 0) do={ + :if ([ :len [ /system/scheduler/find where name=$0 ] ] > 0 && $QueueLen = 0) do={ $LogPrintExit2 warning $0 ("Flushing Telegram messages from scheduler, but queue is empty.") false; } @@ -45,7 +45,7 @@ } :if ($AllDone = true && $QueueLen = [ :len $TelegramQueue ]) do={ - /system/scheduler/remove [ find where name="FlushTelegramQueue" ]; + /system/scheduler/remove [ find where name=$0 ]; :set TelegramQueue; } } @@ -146,8 +146,8 @@ " " . [ /system/clock/get time ] . " and may be obsolete.") "plain" ]) ]); :set ($TelegramQueue->[ :len $TelegramQueue ]) { chatid=$ChatId; tokenid=$TokenId; parsemode=$ParseMode; text=$Text; silent=($Notification->"silent") }; - :if ([ :len [ /system/scheduler/find where name="FlushTelegramQueue" ] ] = 0) do={ - /system/scheduler/add name=FlushTelegramQueue interval=1m start-time=startup \ + :if ([ :len [ /system/scheduler/find where name="\$FlushTelegramQueue" ] ] = 0) do={ + /system/scheduler/add name="\$FlushTelegramQueue" interval=1m start-time=startup \ on-event=(":global FlushTelegramQueue; \$FlushTelegramQueue;"); } } -- cgit v1.2.3-70-g09d2