danielstjules / redislock

Node distributed locking using redis
MIT License
110 stars 32 forks source link

retries: -1 === forever? #6

Closed darkpixel closed 7 years ago

darkpixel commented 8 years ago

I'd love to see the ability to pass -1 as an option to retries to keep retrying forever.

In my use case I have several servers running a job scheduler, but I don't want all three scheduling duplicate jobs. But if one of the scheduler processes crashes (or the server goes down), I want another scheduler to acquire the lock and take over.

danielstjules commented 7 years ago

I'd welcome a PR! Not currently using this module, though I might have time to hack on it a bit later.

danielstjules commented 7 years ago

Thanks!