mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-13 03:24:28 +02:00
mod/notification-matrix: $FlushMatrixQueue: use $0 for scheduler name
This commit is contained in:
parent
47e4f292cb
commit
c33e813f20
1 changed files with 4 additions and 4 deletions
|
@ -24,7 +24,7 @@
|
|||
:local AllDone true;
|
||||
:local QueueLen [ :len $MatrixQueue ];
|
||||
|
||||
:if ([ :len [ /system/scheduler/find where name="FlushMatrixQueue" ] ] > 0 && $QueueLen = 0) do={
|
||||
:if ([ :len [ /system/scheduler/find where name=$0 ] ] > 0 && $QueueLen = 0) do={
|
||||
$LogPrintExit2 warning $0 ("Flushing Matrix messages from scheduler, but queue is empty.") false;
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
|||
}
|
||||
|
||||
:if ($AllDone = true && $QueueLen = [ :len $MatrixQueue ]) do={
|
||||
/system/scheduler/remove [ find where name="FlushMatrixQueue" ];
|
||||
/system/scheduler/remove [ find where name=$0 ];
|
||||
:set MatrixQueue;
|
||||
}
|
||||
}
|
||||
|
@ -139,8 +139,8 @@
|
|||
:set ($MatrixQueue->[ :len $MatrixQueue ]) { room=$Room; \
|
||||
accesstoken=$AccessToken; homeserver=$HomeServer; \
|
||||
plain=$Plain; formatted=$Formatted };
|
||||
:if ([ :len [ /system/scheduler/find where name="FlushMatrixQueue" ] ] = 0) do={
|
||||
/system/scheduler/add name=FlushMatrixQueue interval=1m start-time=startup \
|
||||
:if ([ :len [ /system/scheduler/find where name="\$FlushMatrixQueue" ] ] = 0) do={
|
||||
/system/scheduler/add name="\$FlushMatrixQueue" interval=1m start-time=startup \
|
||||
on-event=(":global FlushMatrixQueue; \$FlushMatrixQueue;");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue