py-sherlock / sherlock

Easy distributed locks for Python with a choice of backends.
MIT License
374 stars 35 forks source link

RedisLock.renew() is calling self._release_func() instead of self._renew_func() #66

Closed sam-robb-ms closed 1 year ago

sam-robb-ms commented 1 year ago

Line 510:

self._release_func(keys=[self._key_name], args=[self._owner, self.expire])

... should be:

self._renew_func(keys=[self._key_name], args=[self._owner, self.expire])

Confused me for the longest time until I looked at the code and saw what was happening!

Fantastic library, BTW, and exactly what I needed for a project. Very well-done code & documentaiton.

judahrand commented 1 year ago

I've pushed this fix and will aim to release it in the next few hours.

If you're interested in contributing I'd really appreciate it if you could look into improving the integration tests to better test renew and better catch this sort of thing.

judahrand commented 1 year ago

Fix is released in v0.4.1.