Open
Conversation
zyla
reviewed
Jul 12, 2023
| ``` | ||
|
|
||
| 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.
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?
Author
There was a problem hiding this comment.
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.
What happened here? I can't find ngx.null in the docs
Author
There was a problem hiding this comment.
I used nil at first, but this didn't work. I've noticed that other functions in this module use ngx.null instead.
Author
There was a problem hiding this comment.
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
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.
No description provided.