python_dynamodb_lock icon indicating copy to clipboard operation
python_dynamodb_lock copied to clipboard

fix: support a timeout of size 0

Open asbestossupply opened this issue 2 years ago • 0 comments

Instances of the timedelta class with all zeros are considered Falsey. This behavior causes python-dynamodb-lock to fall back to the default retry_period and retry_timeout not only if those parameters are passed None but also if passed a blank (or zero) timedelta. It seems to me that this is not the expected result and this PR checks against None explicitly to allow for the use case where a user might want to only acquire the lock if available immediately.

asbestossupply avatar Sep 06 '22 17:09 asbestossupply