Closed acegilz closed 8 years ago
From README:
:block => 1 # Specify in seconds how long you want to wait for the lock to be released.
# Specify 0 if you need non-blocking sematics and return false immediately. (default: 1)
:sleep => 0.1 # Specify in seconds how long the polling interval should be when :block is given.
# It is NOT recommended to go below 0.01. (default: 0.1)
:expire => 10 # Specify in seconds when the lock should be considered stale when something went wrong
# with the one who held the lock and failed to unlock. (default: 10)
Try parameters in this way:
mutex = RedisMutex.new(key, block: 6.hours, expire: 6.hours)
Keep in mind that it will retry 10 times per second, as sleep
is set at 0.1 by default.
I was wondering what should be the best way to keep trying until we ca get a lock