本节基于Redis实现了系统的限流控制。
Lua脚本准备
local val = redis.call('incr', KEYS[1]) local ttl = redis.call('ttl', KEYS[1]) redis.log(redis.LOG_NOTICE, "incr "..KEYS[1].." "..val); if val == 1 then
本节基于Redis实现了系统的限流控制。
local val = redis.call('incr', KEYS[1]) local ttl = redis.call('ttl', KEYS[1]) redis.log(redis.LOG_NOTICE, "incr "..KEYS[1].." "..val); if val == 1 then