Conversation
index.js
Outdated
Collaborator
There was a problem hiding this comment.
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?
Contributor
Author
There was a problem hiding this comment.
Hmm...yes, it would make more sense. Just submitted a commit for this.
Collaborator
|
I really like this PR and want to merge it, just one more question, don't you want to check the response also for the |
Contributor
Author
|
Yes, of course. Didn't notice there's another |
Collaborator
|
thanks! |
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, I'm the author of ioredis, a node.js redis client that supports Sentinel and Cluster.
I'm using this awesome module in my application, however this module doesn't support ioredis, which means I can't use it with my sentinel servers.
It's trivial to support ioredis since it's compatible with node_redis for most APIs. The only difference is the result of multi in ioredis is
[[err1, res1], [err2, res2], [err3, res3]]and in node_redis is[res1, res2, res3]. Refer to https://github.com/luin/ioredis/wiki/Migrating-from-node_redis for more details.The only change have to be made is changing
(!res || !res[0])to(!res || !res[0] || !res[0][1]), which works with both node_redis and ioredis. What's more, I addedforEachwrapper around the original tests so that it will test this module against both node_redis and ioredis.