mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-30 15:54:56 +02:00
global-functions: $WaitForFile: (mostly) revert changes
This (mostly) reverts commits0e00a228d6
ande08bb2192d
. This is required for RouterOS 7.20beta4. It fixed recursive find for files, and (still, or again?) suffers timing issues getting file properties.
This commit is contained in:
parent
95f8af6234
commit
b3dc8eb92a
1 changed files with 16 additions and 4 deletions
|
@ -1771,14 +1771,26 @@
|
|||
:global MAX;
|
||||
|
||||
:set FileName [ $CleanFilePath $FileName ];
|
||||
:local Delay ([ $MAX [ $EitherOr $WaitTime 2s ] 100ms ] / 10);
|
||||
:local Delay ([ $MAX [ $EitherOr $WaitTime 2s ] 100ms ] / 9);
|
||||
|
||||
:do {
|
||||
:retry {
|
||||
:retry {
|
||||
:if ([ :len [ /file/find where name=$FileName ] ] = 0) do={
|
||||
:error false;
|
||||
}
|
||||
} delay=$Delay max=10;
|
||||
} on-error={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:while ([ :len [ /file/find where name=$FileName ] ] > 0) do={
|
||||
:do {
|
||||
/file/get $FileName;
|
||||
:return true;
|
||||
} delay=$Delay max=10;
|
||||
} on-error={ }
|
||||
} on-error={ }
|
||||
:delay $Delay;
|
||||
:set Delay ($Delay * 3 / 2);
|
||||
}
|
||||
|
||||
:return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue