Skip to content
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

Add support for ioredis #12

Merged
merged 3 commits into from
Oct 12, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Limiter.prototype.get = function (fn) {
if (err) return fn(err);
// If the request has failed, it means the values already
// exist in which case we need to get the latest values.
if (!res || !res[0]) return mget();
if (!res || !res[0] || !res[0][1]) return mget();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only problem that I see is that you rely on the fact that node_redis returns a string result.

I think that a better way would be to check if res[0] is an array, if so, check if res[0][1] exists.
what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm...yes, it would make more sense. Just submitted a commit for this.


fn(null, {
total: max,
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
],
"dependencies": {},
"devDependencies": {
"ioredis": "^1.9.0",
"mocha": "*",
"should": "*",
"redis": "0.10.2"
"redis": "0.10.2",
"should": "*"
},
"license": "MIT",
"contributors": [
Expand Down
Loading