mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-12-06 18:09:28 +00:00
global-functions: $WaitForFile: try less expensive operation
Checking a specific file is less expensive operation than finding one, especially when on hardware with huge storage and lots of files (like RDS). We have to keep the find command in the latter loop, though.
This commit is contained in:
parent
6b0c9ab17d
commit
2773fef9d8
1 changed files with 4 additions and 7 deletions
|
|
@ -1788,13 +1788,10 @@
|
|||
|
||||
:do {
|
||||
:retry {
|
||||
:if ([ :len [ /file/find where name=$FileName ] ] = 0) do={
|
||||
:error false;
|
||||
}
|
||||
/file/get $FileName;
|
||||
:return true;
|
||||
} delay=$Delay max=10;
|
||||
} on-error={
|
||||
:return false;
|
||||
}
|
||||
} on-error={ }
|
||||
|
||||
:while ([ :len [ /file/find where name=$FileName ] ] > 0) do={
|
||||
:do {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue