mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-10 18:14:27 +02:00
global-functions: $FlushEmailQueue: try to avoid running simultaneously
We can not check the status for a *specific* mail, so running simultaneously is a problem. Let's increase the interval to the number of queue items - and hope it helps. Decrease when done.
This commit is contained in:
parent
da87761220
commit
5d973a095a
1 changed files with 3 additions and 1 deletions
|
@ -339,7 +339,7 @@
|
||||||
$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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/ system scheduler set interval=1m [ find where name="FlushEmailQueue" interval=1s ];
|
/ system scheduler set interval=($QueueLen . "m") [ find where name="FlushEmailQueue" ];
|
||||||
|
|
||||||
:foreach Id,Message in=$EmailQueue do={
|
:foreach Id,Message in=$EmailQueue do={
|
||||||
:if ([ :typeof $Message ] = "array" ) do={
|
:if ([ :typeof $Message ] = "array" ) do={
|
||||||
|
@ -364,6 +364,8 @@
|
||||||
:if ($AllDone = true && $QueueLen = [ :len $EmailQueue ]) do={
|
:if ($AllDone = true && $QueueLen = [ :len $EmailQueue ]) do={
|
||||||
/ system scheduler remove [ find where name="FlushEmailQueue" ];
|
/ system scheduler remove [ find where name="FlushEmailQueue" ];
|
||||||
:set EmailQueue;
|
:set EmailQueue;
|
||||||
|
} else={
|
||||||
|
/ system scheduler set interval=1m [ find where name="FlushEmailQueue" ];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue