mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
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.
This commit is contained in:
@@ -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 ];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user