aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-08-06 16:26:22 +0200
committerGravatar Christian Hesse <mail@eworm.de>2023-08-06 16:35:51 +0200
commitc37739c2f6b050c965e0fa734309e1ecbed90add (patch)
treeede7d0c1069c962f86d6da255e55a8dc4d6c37d7
parent0aeb34e5e9cb9ddaee7316b60e0e9eaeadb428d3 (diff)
mod/notification-telegram: introduce $PurgeTelegramQueue
... to purge the queue and remove the scheduler.
-rw-r--r--doc/mod/notification-telegram.md5
-rw-r--r--mod/notification-telegram.rsc9
2 files changed, 14 insertions, 0 deletions
diff --git a/doc/mod/notification-telegram.md b/doc/mod/notification-telegram.md
index 40e6fb1..89659c8 100644
--- a/doc/mod/notification-telegram.md
+++ b/doc/mod/notification-telegram.md
@@ -73,6 +73,11 @@ Place this before you call them:
:global SendTelegram;
:global SendNotification;
+In case there is a situation when the queue needs to be purged there is a
+function available:
+
+ $PurgeTelegramQueue;
+
Tips & Tricks
-------------
diff --git a/mod/notification-telegram.rsc b/mod/notification-telegram.rsc
index 0ab1aa0..ea47b1a 100644
--- a/mod/notification-telegram.rsc
+++ b/mod/notification-telegram.rsc
@@ -8,6 +8,7 @@
:global FlushTelegramQueue;
:global NotificationFunctions;
+:global PurgeTelegramQueue;
:global SendTelegram;
:global SendTelegram2;
@@ -162,6 +163,14 @@
}
}
+# purge the Telegram queue
+:set PurgeTelegramQueue do={
+ :global TelegramQueue;
+
+ /system/scheduler/remove [ find where name="\$FlushTelegramQueue" ];
+ :set TelegramQueue;
+}
+
# send notification via telegram - expects at least two string arguments
:set SendTelegram do={
:global SendTelegram2;