From 8b6f830fe89c9550ed877f50eb6ab59c8fa05911 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 17 Jun 2022 00:57:11 +0200 Subject: 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. --- mod/notification-telegram | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mod') 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 ]; -- cgit v1.2.3-70-g09d2