diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/notification-telegram | 8 |
1 files changed, 4 insertions, 4 deletions
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;"); } } |