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:
Christian Hesse 2025-09-19 17:20:37 +02:00
parent 6b0c9ab17d
commit 2773fef9d8

View file

@ -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 {