filelock icon indicating copy to clipboard operation
filelock copied to clipboard

Support `polling_interval` when using locks as context managers

Open asaf-kali opened this issue 9 months ago • 0 comments

Hi,

In the public acquire interface, you can pass poll_interval (defaults to 0.05). Because the __enter__ method calls acquire without any arguments, there is no way to specify the interval when using FileLock as a context manager.

I suggest adding poll_interval to FileLock.__init__, such that you can control the default (and as such, propagate it down to acquire when no value is given there).

asaf-kali avatar Feb 23 '25 14:02 asaf-kali