Review funkt
This commit is contained in:
30
node_modules/bullmq/dist/esm/scripts/getCountsPerPriority-4.js
generated
vendored
Normal file
30
node_modules/bullmq/dist/esm/scripts/getCountsPerPriority-4.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
const content = `--[[
|
||||
Get counts per provided states
|
||||
Input:
|
||||
KEYS[1] wait key
|
||||
KEYS[2] paused key
|
||||
KEYS[3] meta key
|
||||
KEYS[4] prioritized key
|
||||
ARGV[1...] priorities
|
||||
]]
|
||||
local rcall = redis.call
|
||||
local results = {}
|
||||
local waitKey = KEYS[1]
|
||||
local pausedKey = KEYS[2]
|
||||
local prioritizedKey = KEYS[4]
|
||||
for i = 1, #ARGV do
|
||||
local priority = tonumber(ARGV[i])
|
||||
if priority == 0 then
|
||||
results[#results+1] = rcall("LLEN", waitKey)
|
||||
else
|
||||
results[#results+1] = rcall("ZCOUNT", prioritizedKey,
|
||||
priority * 0x100000000, (priority + 1) * 0x100000000 - 1)
|
||||
end
|
||||
end
|
||||
return results
|
||||
`;
|
||||
export const getCountsPerPriority = {
|
||||
name: 'getCountsPerPriority',
|
||||
content,
|
||||
keys: 4,
|
||||
};
|
||||
Reference in New Issue
Block a user