mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-03-05 05:29:37 +00:00
global-functions: $WaitForFile: use :retry for simplification, ...
... and to work around restrictions in new file handling
This commit is contained in:
parent
dfe37620ab
commit
9c050bf678
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