mirror of
https://github.com/nymurbd/MikroTik-scripts.git
synced 2025-07-15 04:24:31 +02: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:
parent
cf59e7c1a2
commit
8b6f830fe8
1 changed files with 6 additions and 0 deletions
|
@ -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 ];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue