Lua script only has one Redis KEY, the other variable should be ARGV#5
Merged
TheDeveloper merged 2 commits intoTheDeveloper:masterfrom Nov 3, 2014
vedraan:master
Merged
Lua script only has one Redis KEY, the other variable should be ARGV#5TheDeveloper merged 2 commits intoTheDeveloper:masterfrom vedraan:master
TheDeveloper merged 2 commits intoTheDeveloper:masterfrom
vedraan:master
Conversation
parityDel lua only uses one key, the other variable should be ARGV
content is an ARGV, not a Redis key. Causes some confusion for Redis Lua newbies
Owner
|
Indeed, ARGV should be used here instead of 2 keys. Thank you! |
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.
Since I'm a Redis Lua scripting newbie, it took some time for me to realize why KEYS (two of them) were used here. While using keys for both key and content works, content isn't really a Redis key and causes some confusion.
Official Redis dist.lock article also uses ARGV for the random value (http://redis.io/topics/distlock), so this might be a good correction. Great work BTW. I did some digging and I think this might be the only real node.js implementation of true Redlock algorithm.