Files
simple-mail-cleaner/backend/node_modules/bullmq/dist/esm/commands/includes/isJobSchedulerJob.lua
2026-01-22 15:49:12 +01:00

16 lines
503 B
Lua

--[[
Function to check if the job belongs to a job scheduler and
current delayed job matches with jobId
]]
local function isJobSchedulerJob(jobId, jobKey, jobSchedulersKey)
local repeatJobKey = rcall("HGET", jobKey, "rjk")
if repeatJobKey then
local prevMillis = rcall("ZSCORE", jobSchedulersKey, repeatJobKey)
if prevMillis then
local currentDelayedJobId = "repeat:" .. repeatJobKey .. ":" .. prevMillis
return jobId == currentDelayedJobId
end
end
return false
end