Join GitHub today
Support unlocking deadlocks with setnx/getset #4
This patch adds unlocking behavior when a worker somehow gets dead while obtaining a lock without cleaning it up and causes deadlocks. The code uses a design pattern used in http://redis.io/commands/setnx using SETNX and GETSET, to avoid the race condition.
To make it work i changed the value of lock to be an integer (UNIX timestamp) rather than a time string as it used to be.
This addresses #1.