Review funkt
This commit is contained in:
19
node_modules/bullmq/dist/cjs/commands/includes/removeLock.lua
generated
vendored
Normal file
19
node_modules/bullmq/dist/cjs/commands/includes/removeLock.lua
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
local function removeLock(jobKey, stalledKey, token, jobId)
|
||||
if token ~= "0" then
|
||||
local lockKey = jobKey .. ':lock'
|
||||
local lockToken = rcall("GET", lockKey)
|
||||
if lockToken == token then
|
||||
rcall("DEL", lockKey)
|
||||
rcall("SREM", stalledKey, jobId)
|
||||
else
|
||||
if lockToken then
|
||||
-- Lock exists but token does not match
|
||||
return -6
|
||||
else
|
||||
-- Lock is missing completely
|
||||
return -2
|
||||
end
|
||||
end
|
||||
end
|
||||
return 0
|
||||
end
|
||||
Reference in New Issue
Block a user