mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-06-28 12:20:07 +02:00
global-functions: $WaitForFile: allow to give iterations...
... to increase timeout. Every iteration is about 100ms.
This commit is contained in:
parent
f62328ee8d
commit
f666d2f8ff
1 changed files with 3 additions and 1 deletions
|
@ -1213,14 +1213,16 @@
|
|||
# wait for file to be available
|
||||
:set WaitForFile do={
|
||||
:local FileName [ :tostr $1 ];
|
||||
:local Iter [ :tonum $2 ];
|
||||
|
||||
:global CleanFilePath;
|
||||
:global EitherOr;
|
||||
|
||||
:set FileName [ $CleanFilePath $FileName ];
|
||||
:local I 0;
|
||||
|
||||
:while ([ :len [ /file/find where name=$FileName ] ] = 0) do={
|
||||
:if ($I > 20) do={
|
||||
:if ($I > [ $EitherOr $Iter 20 ]) do={
|
||||
:return false;
|
||||
}
|
||||
:delay 100ms;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue