mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
feat: @discordjs/brokers (#8548)
This commit is contained in:
16
packages/brokers/scripts/xcleangroup.lua
Normal file
16
packages/brokers/scripts/xcleangroup.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
local info = redis.call('XINFO', 'CONSUMERS', KEYS[1], ARGS[1])
|
||||
local empty = true
|
||||
|
||||
for k, consumer in pairs(info) do
|
||||
if consumer['idle'] != 0 then
|
||||
empty = false
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if empty then
|
||||
redis.call('XGROUP', 'DESTROY', KEYS[1], ARGS[1])
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
Reference in New Issue
Block a user