Skip to content

Lua script only has one Redis KEY, the other variable should be ARGV#5

Merged
TheDeveloper merged 2 commits intoTheDeveloper:masterfrom
vedraan:master
Nov 3, 2014
Merged

Lua script only has one Redis KEY, the other variable should be ARGV#5
TheDeveloper merged 2 commits intoTheDeveloper:masterfrom
vedraan:master

Conversation

@vedraan
Copy link
Copy Markdown
Contributor

@vedraan vedraan commented Nov 1, 2014

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.

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
@TheDeveloper
Copy link
Copy Markdown
Owner

Indeed, ARGV should be used here instead of 2 keys. Thank you!

@TheDeveloper TheDeveloper merged commit 56c863b into TheDeveloper:master Nov 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants