aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2022-06-17 00:57:11 +0200
committerGravatar Christian Hesse <mail@eworm.de>2022-06-20 11:29:49 +0200
commit8b6f830fe89c9550ed877f50eb6ab59c8fa05911 (patch)
tree0fa459f43253f8807296bd2f3aecd891648c64a4
parentcf59e7c1a213a2ce45a48344deda2897dc5db1e4 (diff)
mod/notification-telegram: only flush queue if fully connected
The fetch command is not as reliable as it should be... Chances were that notifications were sent multiple times if stuck in background. Let's flush only if fully connected - and hope this fixes it.
-rw-r--r--mod/notification-telegram6
1 files changed, 6 insertions, 0 deletions
diff --git a/mod/notification-telegram b/mod/notification-telegram
index 7b41c5e..493aa00 100644
--- a/mod/notification-telegram
+++ b/mod/notification-telegram
@@ -12,8 +12,14 @@
:set FlushTelegramQueue do={
:global TelegramQueue;
+ :global IsFullyConnected;
:global LogPrintExit2;
+ :if ([ $IsFullyConnected ] = false) do={
+ $LogPrintExit2 debug $0 ("System is not fully connected, not flushing.") false;
+ :return false;
+ }
+
:local AllDone true;
:local QueueLen [ :len $TelegramQueue ];