Projektstart
This commit is contained in:
15
backend/node_modules/bullmq/dist/cjs/commands/includes/removeJobsByMaxCount.lua
generated
vendored
Normal file
15
backend/node_modules/bullmq/dist/cjs/commands/includes/removeJobsByMaxCount.lua
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
--[[
|
||||
Functions to remove jobs by max count.
|
||||
]]
|
||||
|
||||
-- Includes
|
||||
--- @include "removeJob"
|
||||
|
||||
local function removeJobsByMaxCount(maxCount, targetSet, prefix)
|
||||
local start = maxCount
|
||||
local jobIds = rcall("ZREVRANGE", targetSet, start, -1)
|
||||
for i, jobId in ipairs(jobIds) do
|
||||
removeJob(jobId, false, prefix, false --[[remove debounce key]])
|
||||
end
|
||||
rcall("ZREMRANGEBYRANK", targetSet, 0, -(maxCount + 1))
|
||||
end
|
||||
Reference in New Issue
Block a user