bug fix in backoff

This commit is contained in:
Brian Gough 2017-05-16 16:31:28 +01:00
parent c7d8fbbb8a
commit dff6e2c3da

View file

@ -56,7 +56,7 @@ module.exports = LockManager =
else
setTimeout attempt, testInterval
# back off when the lock is taken to avoid overloading
testInterval = Math.max(testInterval * 2, LockManager.MAX_TEST_INTERVAL)
testInterval = Math.min(testInterval * 2, LockManager.MAX_TEST_INTERVAL)
checkLock: (doc_id, callback = (err, isFree)->)->
key = keys.blockingKey(doc_id:doc_id)