Closed violuke closed 1 year ago
Firstly, thanks for the great package
I wanted to set timeout=0 to effectively have just one attempt to get the lock, but the code is as follows:
timeout=0
if kwargs.get('timeout'): self.timeout = kwargs['timeout'] else: self.timeout = _configuration.timeout
And so the 0 is Falsey and it instead uses _configuration.timeout when it shouldn't.
0
_configuration.timeout
I'd suggest this be changed to:
if 'timeout' in kwargs: self.timeout = kwargs['timeout'] else: self.timeout = _configuration.timeout
Thanks.
Hey @violuke
Do you want to submit that change in a PR? Looks like a reasonable solution!
Thanks @judahrand that's done :+1:
Firstly, thanks for the great package
I wanted to set
timeout=0
to effectively have just one attempt to get the lock, but the code is as follows:And so the
0
is Falsey and it instead uses_configuration.timeout
when it shouldn't.I'd suggest this be changed to:
Thanks.