Does anyone know of a way I could set a timeout on...
# cfml-general
j
Does anyone know of a way I could set a timeout on a DirectoryExists() or FileExists() call in Lucee? We have files stored in Amazon EFS, and once in a while the file system is unreachable. A few pages in our web app check if certain files exist when the page loads, and if EFS is unreachable, the page won't load. The real fix will be figuring out why we sometimes can't connect to EFS, but being able to set a timeout on the FileExists() call would be helpful in the meantime
d
how about doing a healthcheck before?
j
Would that be something like an API call to EFS to see if it's reachable?
s
you could probably use cfthread with a timeout attribute to move on in the code if it doesn't finish in a certain time frame
👍 1
j
I'll give that a shot, I was considering that as well. Thanks!