修复:Lua script attempted to access a non local key in a cluster node
local key = "rate.limit:" .. KEYS[1]
local limit = tonumber(ARGV[1])
local current = tonumber(redis.call('get', key) or "0")
if current + 1 > limit then
return 0
else
redis.call("INCR", key)
redis.call("expire", key,ARGV[2])
return current + 1
.
原创
2022-01-25 18:11:42 ·
3262 阅读 ·
0 评论