-
-
Notifications
You must be signed in to change notification settings - Fork 128
Closed
Labels
Description
Hi,
It seems that the latest docs (https://filelock.readthedocs.io/en/latest/) is not aligned with the code.
I wanted to try acquire a lock but without blocking if alreadly locked. for this to happen I expected the timeout param to acquire to be equal to 0 (as in many other locking primitives).
The docs says (acquire method of BaseFileLock) that
If timeout <= 0, there is no timeout and this method will block until the lock could be acquired
According to source code (both docstring of BaseFileLock.acquire and method source code) if timeout == 0 the method won't block.
BaseFileLock.acquire docstring:
:arg float timeout:
The maximum time waited for the file lock.
If ``timeout < 0``, there is no timeout and this method will
block until the lock could be acquired.
If ``timeout`` is None, the default :attr:`~timeout` is used.
BaseFileLock.acquire code:
elif timeout >= 0 and time.time() - start_time > timeout:
logger().debug('Timeout on acquiring lock %s on %s', lock_id, lock_filename)
raise Timeout(self._lock_file)
Why latest docs are not aligned - is it just not up-to-date? what needed in order to regenerate it to be aligned.
Thanks!
Reactions are currently unavailable