-
Notifications
You must be signed in to change notification settings - Fork 0
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
Use atomic set #1
base: master
Are you sure you want to change the base?
Conversation
@@ -611,7 +611,7 @@ storage_config = { | |||
} | |||
``` | |||
|
|||
Redis >= 2.6.0 is required as this storage requires [PEXPIRE](https://redis.io/commands/pexpire). | |||
Redis >= 2.6.12 is required as this storage requires [SET EX](https://redis.io/commands/set). |
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 wonder who uses such antique versions anyway (current is 7.0, 2.6 is not listed in release notes but seems to be from 2015).
Or are there two different versioning schemes?
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.
Haha, https://gist.github.com/lqez/3944436 11 years ago. Maybe it's just 🦖 old.
if err then | ||
return err | ||
elseif ok == 0 then | ||
elseif ok == ngx.null then |
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.
What happened here? I can't find ngx.null
in the docs
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 used nil
at first, but this didn't work. I've noticed that other functions in this module use ngx.null
instead.
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.
Lua's nil value in an array-like Lua table can make "holes" in the array, which is troublesome for many things, like with the # operator.
When being returned directly as a single value, we need to distinguish a Lua nil value that indicates a low-level error (like network communication failures or timeout) and a valid redis-land null value.
For unit testing, you can swap your lua or luajit command with the resty command (which is provided by OpenResty under <openresty-prefix>/bin/. See
https://github.com/openresty/resty-cli
for the documentation.
c153c61
to
353e371
Compare
No description provided.