Skip to content
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

Redis eval命令踩得那些坑 #21

Open
hackfengJam opened this issue Apr 25, 2021 · 1 comment
Open

Redis eval命令踩得那些坑 #21

hackfengJam opened this issue Apr 25, 2021 · 1 comment

Comments

@hackfengJam
Copy link
Owner

hackfengJam commented Apr 25, 2021

根据 key 是否存在,返回 404

BAD

local rst = redis.call("hmget",KEYS[1],"remain","lock",ARGV[1])
rst[1] == nil then
	return 404
end

GOOD

local rst = redis.call("hmget",KEYS[1],"remain","lock",ARGV[1])
rst[1] == nil or rst[1] == false then
	return 404
end
@hackfengJam
Copy link
Owner Author

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

No branches or pull requests

1 participant