-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixes #29 #30
fixes #29 #30
Conversation
@@ -104,21 +104,22 @@ Limiter.prototype.get = function (fn) { | |||
} | |||
|
|||
db.multi() | |||
.set([count, n - 1, 'PX', ex * 1000 - dateNow, 'XX']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering why we didn't change it before 🤔
if (err) return fn(err); | ||
if (isFirstReplyNull(res)) return mget(); | ||
n = n - 1; | ||
n = Array.isArray(res[0]) ? ~~res[0][1] : ~~res[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible that the return value would not be an array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is redis
module, then res[0]
is a string value. If it's ioredis
then it's an array.
In general it looks ok, thanks. |
sure |
Hi, I'll merge it next week. I won't be near a computer till then. |
The tests are failing randomly. (off by 1 sometimes. best guess is round off errors) |
Race condition when used with
async.times