Comparing version 4.12.8 to 4.12.9
@@ -0,1 +1,8 @@ | ||
## [4.12.9](https://github.com/OptimalBits/bull/compare/v4.12.8...v4.12.9) (2024-05-24) | ||
### Bug Fixes | ||
* **retry-job:** throw error when job is not in active state ([#2741](https://github.com/OptimalBits/bull/issues/2741)) ([c29e3b0](https://github.com/OptimalBits/bull/commit/c29e3b061a168c3d40a336a733c382bab14caa57)) | ||
## [4.12.8](https://github.com/OptimalBits/bull/compare/v4.12.7...v4.12.8) (2024-05-22) | ||
@@ -2,0 +9,0 @@ |
@@ -33,2 +33,3 @@ 'use strict'; | ||
-2 Missing lock. | ||
-3 - Job not in active set. | ||
Events: | ||
@@ -71,11 +72,26 @@ 'completed/failed' | ||
end | ||
-- Includes | ||
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 | ||
if rcall("EXISTS", KEYS[3]) == 1 then -- // Make sure job exists | ||
if ARGV[5] ~= "0" then | ||
local lockKey = KEYS[3] .. ':lock' | ||
if rcall("GET", lockKey) == ARGV[5] then | ||
rcall("DEL", lockKey) | ||
rcall("SREM", KEYS[8], ARGV[1]) | ||
else | ||
return -2 | ||
end | ||
local errorCode = removeLock(KEYS[3], KEYS[8], ARGV[5], ARGV[1]) | ||
if errorCode < 0 then | ||
return errorCode | ||
end | ||
@@ -82,0 +98,0 @@ -- Remove from active list (if not active we shall return error) |
@@ -21,2 +21,3 @@ 'use strict'; | ||
-2 - Job Not locked | ||
-3 - Job not in active set | ||
]] | ||
@@ -50,14 +51,28 @@ local rcall = redis.call | ||
end | ||
if rcall("EXISTS", KEYS[3]) == 1 then | ||
-- Check for job lock | ||
if ARGV[3] ~= "0" then | ||
local lockKey = KEYS[3] .. ':lock' | ||
if rcall("GET", lockKey) == ARGV[3] then | ||
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", KEYS[6], ARGV[2]) | ||
rcall("SREM", stalledKey, jobId) | ||
else | ||
return -2 | ||
if lockToken then | ||
-- Lock exists but token does not match | ||
return -6 | ||
else | ||
-- Lock is missing completely | ||
return -2 | ||
end | ||
end | ||
end | ||
rcall("LREM", KEYS[1], 0, ARGV[2]) | ||
return 0 | ||
end | ||
if rcall("EXISTS", KEYS[3]) == 1 then | ||
local errorCode = removeLock(KEYS[3], KEYS[6], ARGV[3], ARGV[2]) | ||
if errorCode < 0 then | ||
return errorCode | ||
end | ||
local numRemovedElements = rcall("LREM", KEYS[1], -1, ARGV[2]) | ||
if numRemovedElements < 1 then return -3 end | ||
local target = getTargetQueueList(KEYS[4], KEYS[2], KEYS[5]) | ||
@@ -64,0 +79,0 @@ local priority = tonumber(rcall("HGET", KEYS[3], "priority")) or 0 |
{ | ||
"name": "bull", | ||
"version": "4.12.8", | ||
"version": "4.12.9", | ||
"description": "Job manager", | ||
@@ -5,0 +5,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
294551
6035