mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-10 18:14:27 +02:00
global-functions: $FlushEmailQueue: return if time is not synced
The local system time is used in the mail header. We do not want the mails to be sent in the past, so return early (and thus wait for time being synced).
This commit is contained in:
parent
8c31a06b39
commit
3139b14c67
1 changed files with 6 additions and 0 deletions
|
@ -344,10 +344,16 @@
|
||||||
|
|
||||||
:global EitherOr;
|
:global EitherOr;
|
||||||
:global LogPrintExit2;
|
:global LogPrintExit2;
|
||||||
|
:global TimeIsSync;
|
||||||
|
|
||||||
:local AllDone true;
|
:local AllDone true;
|
||||||
:local QueueLen [ :len $EmailQueue ];
|
:local QueueLen [ :len $EmailQueue ];
|
||||||
|
|
||||||
|
:if ([ $TimeIsSync ] = false) do={
|
||||||
|
$LogPrintExit2 debug $0 ("Time is not synced, not flushing.") false;
|
||||||
|
:return false;
|
||||||
|
}
|
||||||
|
|
||||||
:if ([ :len [ /system/scheduler/find where name="FlushEmailQueue" ] ] > 0 && $QueueLen = 0) do={
|
:if ([ :len [ /system/scheduler/find where name="FlushEmailQueue" ] ] > 0 && $QueueLen = 0) do={
|
||||||
$LogPrintExit2 warning $0 ("Flushing E-Mail messages from scheduler, but queue is empty.") false;
|
$LogPrintExit2 warning $0 ("Flushing E-Mail messages from scheduler, but queue is empty.") false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue