mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
lease-script: do not run in parallel on simultaneous deassign
This commit is contained in:
parent
855399b2bc
commit
407a379f1d
1 changed files with 5 additions and 2 deletions
|
@ -10,8 +10,9 @@
|
|||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:global LogPrintExit2;
|
||||
:global IfThenElse;
|
||||
:global LogPrintExit2;
|
||||
:global RandomDelay;
|
||||
|
||||
:if ([ :typeof $leaseActIP ] = "nothing" || \
|
||||
[ :typeof $leaseActMAC ] = "nothing" || \
|
||||
|
@ -25,8 +26,10 @@
|
|||
$LogPrintExit2 debug $0 ("DHCP Server " . $leaseServerName . " " . \
|
||||
$State . "ed lease " . $leaseActIP . " to " . $leaseActMAC) false;
|
||||
|
||||
# delay a moment to update the lease table, do not run in parallel for de/assign
|
||||
# delay a moment to update the lease table, do not run in parallel for de/assign...
|
||||
:delay ((1 + $leaseBound) . "s");
|
||||
# ... or simultaneous deassign
|
||||
$RandomDelay (([ :tonum $leaseBound ] ^ 1) * 750) "ms";
|
||||
|
||||
:foreach Script in=[ / system script find where source~("\n# provides: lease-script " . $State . "\n") ] do={
|
||||
:local ScriptName [ / system script get $Script name ];
|
||||
|
|
Loading…
Reference in a new issue