Closed markplindsay closed 9 years ago
This doesn't seem safe. Since acquiring the lock is now two operations and not atomic or locking in their own right we cannot guarantee that two clients didn't ask for the lock at the same time and received it. It's probably safe for development work, but I'm not comfortable pulling it in when it could be used in production.
You're right, glad we've got 2.6 in production! Thanks for taking a look.
My team's development environment is stuck with Redis 2.2 for now. 2.2 doesn't support the extended
nx
andpx
arguments forset
, which came along in Redis 2.6. This PR tries usingsetex
as a fallback if the server doesn't recognize those extra args. It will allow me to use redlock-py in development until we all get with the Redis 2.6+ program. Others in the same boat as me may find it useful as well.