report key and model queue saturation separately
This commit is contained in:
1 parent
16981fd307
commit
b54b6a8ac4
2 files changed
+5
-2
No files matched your search
@@ -3,7 +3,7 @@ local now = tonumber(time[1]) * 1000 + math.floor(tonumber(time[2]) / 1000)
|
||||
redis.call('ZREMRANGEBYSCORE', KEYS[1], '-inf', now)
|
||||
redis.call('ZREMRANGEBYSCORE', KEYS[2], '-inf', now)
|
||||
if redis.call('ZCARD', KEYS[1]) >= tonumber(ARGV[1]) then return 0 end
|
||||
if redis.call('ZCARD', KEYS[2]) >= tonumber(ARGV[2]) then return 0 end
|
||||
if redis.call('ZCARD', KEYS[2]) >= tonumber(ARGV[2]) then return 2 end
|
||||
redis.call('ZADD', KEYS[1], now + tonumber(ARGV[3]), ARGV[4])
|
||||
redis.call('ZADD', KEYS[2], now + tonumber(ARGV[3]), ARGV[4])
|
||||
redis.call('PEXPIRE', KEYS[1], ARGV[3])
|
||||
|
||||
Reference in new issue
Block a user