Comments (6)
Quote from the lua-resty-redis
documentation:
A nil bulk reply results in a
ngx.null
return value.
Therefore you need to check against ngx.null
:
if val == ngx.null then
ngx.say("the value is not exists.")
else
ngx.say("val: "..val)
end
from lua-resty-redis.
Thank you for reply, I'm sorry have not focus on it.
I test it and it worked.
from lua-resty-redis.
can you close the issue?
from lua-resty-redis.
(I understand I'm commenting on a closed issue which may mean nobody will remember to respond to this, will try harder later).
README.markdown has this snippet:
local res, err = red:get("dog")
if not res then
ngx.say("failed to get dog: ", err)
return
end
and that's how I ran into this 'issue' as well. Is the README indeed wrong? Want me to submit a patch for it?
from lua-resty-redis.
No, the doc is correct and precise. Look more carefully.
from lua-resty-redis.
nil is returned for fatal errors like network problems, which is apparently a different thing.
from lua-resty-redis.
Related Issues (20)
- How to connect redisDB with user id and password? HOT 1
- Confusing instructions for installation on README.md
- redis:connect is taking exactly 60 seconds for connection
- SSL not working
- The performance of redis pipeline mode is unstable HOT 3
- CLIENT SETNAME?
- redis:get(key) question HOT 2
- opm package outdated HOT 1
- Connection pool not creating HOT 2
- How to create a single redis connection HOT 5
- this support two-way authentication?
- Add keepalive for redis client to make the connections reliable
- Nginx 1.24 HOT 2
- Nginx creates more connection than poolsize, backlog to redis HOT 5
- lua tcp socket read timed out, context: ssl_certificate_by_lua*, client: 172.69.58.204, server: 0.0.0.0:443 HOT 2
- redis set_keepalive doesn't work HOT 1
- lua entry thread aborted: runtime error: /usr/local/openresty/lualib/resty/redis.lua:357: bad request HOT 1
- no request found HOT 1
- Add the host:port to the error message
- Reading from client: error:0A000126:SSL routines::unexpected eof while reading
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lua-resty-redis.