Hello I am trying to lock a file by using file.flock(File::LOOK_EX)
The problem it is blocking the app if it unable to block the file.
The rescue does not help either.
Is there any way to tell flock to fail if it cannot lock the file on the first try?
You can add the
LOCK_NBconstant:That will prevent the operation from blocking.