mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-06-21 01:25:52 +02:00
global-functions: $WaitForFile: use :retry for simplification, ...
... and to work around restrictions in new file handling.
This commit is contained in:
parent
e08bb2192d
commit
0e00a228d6
1 changed files with 6 additions and 8 deletions
|
@ -1746,16 +1746,14 @@
|
||||||
:global MAX;
|
:global MAX;
|
||||||
|
|
||||||
:set FileName [ $CleanFilePath $FileName ];
|
:set FileName [ $CleanFilePath $FileName ];
|
||||||
:local I 1;
|
|
||||||
:local Delay ([ $MAX [ $EitherOr $WaitTime 2s ] 100ms ] / 10);
|
:local Delay ([ $MAX [ $EitherOr $WaitTime 2s ] 100ms ] / 10);
|
||||||
|
|
||||||
:while ([ :len [ /file/find where name=$FileName ] ] = 0) do={
|
:do {
|
||||||
:if ($I >= 10) do={
|
:retry {
|
||||||
:return false;
|
/file/get $FileName;
|
||||||
}
|
:return true;
|
||||||
:delay $Delay;
|
} delay=$Delay max=10;
|
||||||
:set I ($I + 1);
|
} on-error={ }
|
||||||
}
|
|
||||||
|
|
||||||
:return false;
|
:return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue