mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-15 04:24:29 +02:00
global-functions: $ScriptLock: check for successful removal of ticket
The script is already locked, so there is no second script to remove a ticket at the same time. However a new script can add a new ticket and overwrite the removal... Thus check for successful removal anyway.
This commit is contained in:
parent
8e2c783068
commit
4269bc9548
1 changed files with 9 additions and 5 deletions
|
@ -946,13 +946,17 @@
|
||||||
|
|
||||||
:global ScriptLockOrder;
|
:global ScriptLockOrder;
|
||||||
|
|
||||||
:local New [ :toarray "" ];
|
:while (true) do={
|
||||||
:foreach Ticket in=($ScriptLockOrder->$Script) do={
|
:local New [ :toarray "" ];
|
||||||
:if ($Ticket != $Remove) do={
|
:foreach Ticket in=($ScriptLockOrder->$Script) do={
|
||||||
:set New ($New, $Ticket);
|
:if ($Ticket != $Remove) do={
|
||||||
|
:set New ($New, $Ticket);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
:set ($ScriptLockOrder->$Script) $New;
|
||||||
|
:delay 12ms;
|
||||||
|
:if (($ScriptLockOrder->$Script->0) != $Remove) do={ :return true; }
|
||||||
}
|
}
|
||||||
:set ($ScriptLockOrder->$Script) $New;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
:if ([ :len [ / system script find where name=$Script ] ] = 0) do={
|
:if ([ :len [ / system script find where name=$Script ] ] = 0) do={
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue