bullmq 5.1.8 → 5.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/classes/scripts.js +12 -5
- package/dist/cjs/classes/scripts.js.map +1 -1
- package/dist/cjs/commands/changeDelay-4.lua +57 -0
- package/dist/cjs/commands/includes/addDelayMarkerIfNeeded.lua +1 -1
- package/dist/cjs/commands/includes/removeParentDependencyKey.lua +4 -2
- package/dist/cjs/scripts/addDelayedJob-6.js +1 -1
- package/dist/cjs/scripts/addParentJob-4.js +1 -1
- package/dist/cjs/scripts/addPrioritizedJob-7.js +1 -1
- package/dist/cjs/scripts/addStandardJob-7.js +1 -1
- package/dist/cjs/scripts/changeDelay-4.js +94 -0
- package/dist/cjs/scripts/changeDelay-4.js.map +1 -0
- package/dist/cjs/scripts/cleanJobsInSet-2.js +4 -2
- package/dist/cjs/scripts/cleanJobsInSet-2.js.map +1 -1
- package/dist/cjs/scripts/drain-4.js +4 -2
- package/dist/cjs/scripts/drain-4.js.map +1 -1
- package/dist/cjs/scripts/index.js +1 -1
- package/dist/cjs/scripts/moveStalledJobsToWait-9.js +4 -2
- package/dist/cjs/scripts/moveStalledJobsToWait-9.js.map +1 -1
- package/dist/cjs/scripts/moveToDelayed-7.js +1 -1
- package/dist/cjs/scripts/moveToFinished-14.js +5 -3
- package/dist/cjs/scripts/moveToFinished-14.js.map +1 -1
- package/dist/cjs/scripts/obliterate-2.js +4 -2
- package/dist/cjs/scripts/obliterate-2.js.map +1 -1
- package/dist/cjs/scripts/pause-7.js +1 -1
- package/dist/cjs/scripts/removeJob-1.js +4 -2
- package/dist/cjs/scripts/removeJob-1.js.map +1 -1
- package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/esm/classes/scripts.js +12 -5
- package/dist/esm/classes/scripts.js.map +1 -1
- package/dist/esm/commands/changeDelay-4.lua +57 -0
- package/dist/esm/commands/includes/addDelayMarkerIfNeeded.lua +1 -1
- package/dist/esm/commands/includes/removeParentDependencyKey.lua +4 -2
- package/dist/esm/scripts/addDelayedJob-6.js +1 -1
- package/dist/esm/scripts/addParentJob-4.js +1 -1
- package/dist/esm/scripts/addPrioritizedJob-7.js +1 -1
- package/dist/esm/scripts/addStandardJob-7.js +1 -1
- package/dist/esm/scripts/changeDelay-4.js +91 -0
- package/dist/esm/scripts/changeDelay-4.js.map +1 -0
- package/dist/esm/scripts/cleanJobsInSet-2.js +4 -2
- package/dist/esm/scripts/cleanJobsInSet-2.js.map +1 -1
- package/dist/esm/scripts/drain-4.js +4 -2
- package/dist/esm/scripts/drain-4.js.map +1 -1
- package/dist/esm/scripts/index.d.ts +1 -1
- package/dist/esm/scripts/index.js +1 -1
- package/dist/esm/scripts/moveStalledJobsToWait-9.js +4 -2
- package/dist/esm/scripts/moveStalledJobsToWait-9.js.map +1 -1
- package/dist/esm/scripts/moveToDelayed-7.js +1 -1
- package/dist/esm/scripts/moveToFinished-14.js +5 -3
- package/dist/esm/scripts/moveToFinished-14.js.map +1 -1
- package/dist/esm/scripts/obliterate-2.js +4 -2
- package/dist/esm/scripts/obliterate-2.js.map +1 -1
- package/dist/esm/scripts/pause-7.js +1 -1
- package/dist/esm/scripts/removeJob-1.js +4 -2
- package/dist/esm/scripts/removeJob-1.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/cjs/commands/changeDelay-3.lua +0 -41
- package/dist/cjs/scripts/changeDelay-3.js +0 -42
- package/dist/cjs/scripts/changeDelay-3.js.map +0 -1
- package/dist/esm/commands/changeDelay-3.lua +0 -41
- package/dist/esm/scripts/changeDelay-3.js +0 -39
- package/dist/esm/scripts/changeDelay-3.js.map +0 -1
- /package/dist/esm/scripts/{changeDelay-3.d.ts → changeDelay-4.d.ts} +0 -0
@@ -0,0 +1,91 @@
|
|
1
|
+
const content = `--[[
|
2
|
+
Change job delay when it is in delayed set.
|
3
|
+
Input:
|
4
|
+
KEYS[1] delayed key
|
5
|
+
KEYS[2] meta key
|
6
|
+
KEYS[3] marker key
|
7
|
+
KEYS[4] events stream
|
8
|
+
ARGV[1] delay
|
9
|
+
ARGV[2] delayedTimestamp
|
10
|
+
ARGV[3] the id of the job
|
11
|
+
ARGV[4] job key
|
12
|
+
Output:
|
13
|
+
0 - OK
|
14
|
+
-1 - Missing job.
|
15
|
+
-3 - Job not in delayed set.
|
16
|
+
Events:
|
17
|
+
- delayed key.
|
18
|
+
]]
|
19
|
+
local rcall = redis.call
|
20
|
+
-- Includes
|
21
|
+
--[[
|
22
|
+
Add delay marker if needed.
|
23
|
+
]]
|
24
|
+
-- Includes
|
25
|
+
--[[
|
26
|
+
Function to return the next delayed job timestamp.
|
27
|
+
]]
|
28
|
+
local function getNextDelayedTimestamp(delayedKey)
|
29
|
+
local result = rcall("ZRANGE", delayedKey, 0, 0, "WITHSCORES")
|
30
|
+
if #result then
|
31
|
+
local nextTimestamp = tonumber(result[2])
|
32
|
+
if (nextTimestamp ~= nil) then
|
33
|
+
nextTimestamp = nextTimestamp / 0x1000
|
34
|
+
end
|
35
|
+
return nextTimestamp
|
36
|
+
end
|
37
|
+
end
|
38
|
+
local function addDelayMarkerIfNeeded(markerKey, delayedKey)
|
39
|
+
local nextTimestamp = getNextDelayedTimestamp(delayedKey)
|
40
|
+
if nextTimestamp ~= nil then
|
41
|
+
-- Replace the score of the marker with the newest known
|
42
|
+
-- next timestamp.
|
43
|
+
rcall("ZADD", markerKey, nextTimestamp, "1")
|
44
|
+
end
|
45
|
+
end
|
46
|
+
--[[
|
47
|
+
Function to get max events value or set by default 10000.
|
48
|
+
]]
|
49
|
+
local function getOrSetMaxEvents(metaKey)
|
50
|
+
local maxEvents = rcall("HGET", metaKey, "opts.maxLenEvents")
|
51
|
+
if not maxEvents then
|
52
|
+
maxEvents = 10000
|
53
|
+
rcall("HSET", metaKey, "opts.maxLenEvents", maxEvents)
|
54
|
+
end
|
55
|
+
return maxEvents
|
56
|
+
end
|
57
|
+
--[[
|
58
|
+
Function to check for the meta.paused key to decide if we are paused or not
|
59
|
+
(since an empty list and !EXISTS are not really the same).
|
60
|
+
]]
|
61
|
+
local function isQueuePaused(queueMetaKey)
|
62
|
+
return rcall("HEXISTS", queueMetaKey, "paused") == 1
|
63
|
+
end
|
64
|
+
if rcall("EXISTS", ARGV[4]) == 1 then
|
65
|
+
local jobId = ARGV[3]
|
66
|
+
local score = tonumber(ARGV[2])
|
67
|
+
local delayedTimestamp = (score / 0x1000)
|
68
|
+
local numRemovedElements = rcall("ZREM", KEYS[1], jobId)
|
69
|
+
if numRemovedElements < 1 then
|
70
|
+
return -3
|
71
|
+
end
|
72
|
+
rcall("HSET", ARGV[4], "delay", tonumber(ARGV[1]))
|
73
|
+
rcall("ZADD", KEYS[1], score, jobId)
|
74
|
+
local maxEvents = getOrSetMaxEvents(KEYS[2])
|
75
|
+
rcall("XADD", KEYS[4], "MAXLEN", "~", maxEvents, "*", "event", "delayed",
|
76
|
+
"jobId", jobId, "delay", delayedTimestamp)
|
77
|
+
-- mark that a delayed job is available
|
78
|
+
local isPaused = isQueuePaused(KEYS[2])
|
79
|
+
if not isPaused then
|
80
|
+
addDelayMarkerIfNeeded(KEYS[3], KEYS[1])
|
81
|
+
end
|
82
|
+
return 0
|
83
|
+
else
|
84
|
+
return -1
|
85
|
+
end`;
|
86
|
+
export const changeDelay = {
|
87
|
+
name: 'changeDelay',
|
88
|
+
content,
|
89
|
+
keys: 4,
|
90
|
+
};
|
91
|
+
//# sourceMappingURL=changeDelay-4.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"changeDelay-4.js","sourceRoot":"","sources":["../../../src/scripts/changeDelay-4.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoFZ,CAAC;AACL,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,aAAa;IACnB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
|
@@ -91,7 +91,8 @@ local function getTargetQueueList(queueMetaKey, waitKey, pausedKey)
|
|
91
91
|
end
|
92
92
|
end
|
93
93
|
local function moveParentToWait(parentPrefix, parentId, emitEvent)
|
94
|
-
local parentTarget, isPaused = getTargetQueueList(parentPrefix .. "meta", parentPrefix .. "wait",
|
94
|
+
local parentTarget, isPaused = getTargetQueueList(parentPrefix .. "meta", parentPrefix .. "wait",
|
95
|
+
parentPrefix .. "paused")
|
95
96
|
addJobInTargetList(parentTarget, parentPrefix .. "marker", "RPUSH", isPaused, parentId)
|
96
97
|
if emitEvent then
|
97
98
|
local parentEventStream = parentPrefix .. "events"
|
@@ -125,7 +126,8 @@ local function removeParentDependencyKey(jobKey, hard, parentKey, baseKey)
|
|
125
126
|
end
|
126
127
|
else
|
127
128
|
local missedParentKey = rcall("HGET", jobKey, "parentKey")
|
128
|
-
if( (type(missedParentKey) == "string") and missedParentKey ~= ""
|
129
|
+
if( (type(missedParentKey) == "string") and missedParentKey ~= ""
|
130
|
+
and (rcall("EXISTS", missedParentKey) == 1)) then
|
129
131
|
local parentDependenciesKey = missedParentKey .. ":dependencies"
|
130
132
|
local result = rcall("SREM", parentDependenciesKey, jobKey)
|
131
133
|
if result > 0 then
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cleanJobsInSet-2.js","sourceRoot":"","sources":["../../../src/scripts/cleanJobsInSet-2.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG
|
1
|
+
{"version":3,"file":"cleanJobsInSet-2.js","sourceRoot":"","sources":["../../../src/scripts/cleanJobsInSet-2.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Rf,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,gBAAgB;IACtB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
|
@@ -66,7 +66,8 @@ local function getTargetQueueList(queueMetaKey, waitKey, pausedKey)
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
local function moveParentToWait(parentPrefix, parentId, emitEvent)
|
69
|
-
local parentTarget, isPaused = getTargetQueueList(parentPrefix .. "meta", parentPrefix .. "wait",
|
69
|
+
local parentTarget, isPaused = getTargetQueueList(parentPrefix .. "meta", parentPrefix .. "wait",
|
70
|
+
parentPrefix .. "paused")
|
70
71
|
addJobInTargetList(parentTarget, parentPrefix .. "marker", "RPUSH", isPaused, parentId)
|
71
72
|
if emitEvent then
|
72
73
|
local parentEventStream = parentPrefix .. "events"
|
@@ -100,7 +101,8 @@ local function removeParentDependencyKey(jobKey, hard, parentKey, baseKey)
|
|
100
101
|
end
|
101
102
|
else
|
102
103
|
local missedParentKey = rcall("HGET", jobKey, "parentKey")
|
103
|
-
if( (type(missedParentKey) == "string") and missedParentKey ~= ""
|
104
|
+
if( (type(missedParentKey) == "string") and missedParentKey ~= ""
|
105
|
+
and (rcall("EXISTS", missedParentKey) == 1)) then
|
104
106
|
local parentDependenciesKey = missedParentKey .. ":dependencies"
|
105
107
|
local result = rcall("SREM", parentDependenciesKey, jobKey)
|
106
108
|
if result > 0 then
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"drain-4.js","sourceRoot":"","sources":["../../../src/scripts/drain-4.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG
|
1
|
+
{"version":3,"file":"drain-4.js","sourceRoot":"","sources":["../../../src/scripts/drain-4.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+Lf,CAAC;AACF,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,IAAI,EAAE,OAAO;IACb,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
|
@@ -2,7 +2,7 @@ export * from './addDelayedJob-6';
|
|
2
2
|
export * from './addParentJob-4';
|
3
3
|
export * from './addPrioritizedJob-7';
|
4
4
|
export * from './addStandardJob-7';
|
5
|
-
export * from './changeDelay-
|
5
|
+
export * from './changeDelay-4';
|
6
6
|
export * from './changePriority-6';
|
7
7
|
export * from './cleanJobsInSet-2';
|
8
8
|
export * from './drain-4';
|
@@ -2,7 +2,7 @@ export * from './addDelayedJob-6';
|
|
2
2
|
export * from './addParentJob-4';
|
3
3
|
export * from './addPrioritizedJob-7';
|
4
4
|
export * from './addStandardJob-7';
|
5
|
-
export * from './changeDelay-
|
5
|
+
export * from './changeDelay-4';
|
6
6
|
export * from './changePriority-6';
|
7
7
|
export * from './cleanJobsInSet-2';
|
8
8
|
export * from './drain-4';
|
@@ -83,7 +83,8 @@ local getJobKeyPrefix = function (jobKey, jobId)
|
|
83
83
|
return string.sub(jobKey, 0, #jobKey - #jobId)
|
84
84
|
end
|
85
85
|
local function moveParentToWait(parentPrefix, parentId, emitEvent)
|
86
|
-
local parentTarget, isPaused = getTargetQueueList(parentPrefix .. "meta", parentPrefix .. "wait",
|
86
|
+
local parentTarget, isPaused = getTargetQueueList(parentPrefix .. "meta", parentPrefix .. "wait",
|
87
|
+
parentPrefix .. "paused")
|
87
88
|
addJobInTargetList(parentTarget, parentPrefix .. "marker", "RPUSH", isPaused, parentId)
|
88
89
|
if emitEvent then
|
89
90
|
local parentEventStream = parentPrefix .. "events"
|
@@ -117,7 +118,8 @@ local function removeParentDependencyKey(jobKey, hard, parentKey, baseKey)
|
|
117
118
|
end
|
118
119
|
else
|
119
120
|
local missedParentKey = rcall("HGET", jobKey, "parentKey")
|
120
|
-
if( (type(missedParentKey) == "string") and missedParentKey ~= ""
|
121
|
+
if( (type(missedParentKey) == "string") and missedParentKey ~= ""
|
122
|
+
and (rcall("EXISTS", missedParentKey) == 1)) then
|
121
123
|
local parentDependenciesKey = missedParentKey .. ":dependencies"
|
122
124
|
local result = rcall("SREM", parentDependenciesKey, jobKey)
|
123
125
|
if result > 0 then
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"moveStalledJobsToWait-9.js","sourceRoot":"","sources":["../../../src/scripts/moveStalledJobsToWait-9.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG
|
1
|
+
{"version":3,"file":"moveStalledJobsToWait-9.js","sourceRoot":"","sources":["../../../src/scripts/moveStalledJobsToWait-9.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA0SS,CAAC;AAC1B,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,uBAAuB;IAC7B,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
|
@@ -46,7 +46,7 @@ local function addDelayMarkerIfNeeded(markerKey, delayedKey)
|
|
46
46
|
if nextTimestamp ~= nil then
|
47
47
|
-- Replace the score of the marker with the newest known
|
48
48
|
-- next timestamp.
|
49
|
-
rcall("ZADD", markerKey, nextTimestamp, "
|
49
|
+
rcall("ZADD", markerKey, nextTimestamp, "1")
|
50
50
|
end
|
51
51
|
end
|
52
52
|
--[[
|
@@ -182,7 +182,7 @@ local function addDelayMarkerIfNeeded(markerKey, delayedKey)
|
|
182
182
|
if nextTimestamp ~= nil then
|
183
183
|
-- Replace the score of the marker with the newest known
|
184
184
|
-- next timestamp.
|
185
|
-
rcall("ZADD", markerKey, nextTimestamp, "
|
185
|
+
rcall("ZADD", markerKey, nextTimestamp, "1")
|
186
186
|
end
|
187
187
|
end
|
188
188
|
--[[
|
@@ -341,7 +341,8 @@ local getJobKeyPrefix = function (jobKey, jobId)
|
|
341
341
|
return string.sub(jobKey, 0, #jobKey - #jobId)
|
342
342
|
end
|
343
343
|
local function moveParentToWait(parentPrefix, parentId, emitEvent)
|
344
|
-
local parentTarget, isPaused = getTargetQueueList(parentPrefix .. "meta", parentPrefix .. "wait",
|
344
|
+
local parentTarget, isPaused = getTargetQueueList(parentPrefix .. "meta", parentPrefix .. "wait",
|
345
|
+
parentPrefix .. "paused")
|
345
346
|
addJobInTargetList(parentTarget, parentPrefix .. "marker", "RPUSH", isPaused, parentId)
|
346
347
|
if emitEvent then
|
347
348
|
local parentEventStream = parentPrefix .. "events"
|
@@ -375,7 +376,8 @@ local function removeParentDependencyKey(jobKey, hard, parentKey, baseKey)
|
|
375
376
|
end
|
376
377
|
else
|
377
378
|
local missedParentKey = rcall("HGET", jobKey, "parentKey")
|
378
|
-
if( (type(missedParentKey) == "string") and missedParentKey ~= ""
|
379
|
+
if( (type(missedParentKey) == "string") and missedParentKey ~= ""
|
380
|
+
and (rcall("EXISTS", missedParentKey) == 1)) then
|
379
381
|
local parentDependenciesKey = missedParentKey .. ":dependencies"
|
380
382
|
local result = rcall("SREM", parentDependenciesKey, jobKey)
|
381
383
|
if result > 0 then
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"moveToFinished-14.js","sourceRoot":"","sources":["../../../src/scripts/moveToFinished-14.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG
|
1
|
+
{"version":3,"file":"moveToFinished-14.js","sourceRoot":"","sources":["../../../src/scripts/moveToFinished-14.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4oBf,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,gBAAgB;IACtB,OAAO;IACP,IAAI,EAAE,EAAE;CACT,CAAC"}
|
@@ -68,7 +68,8 @@ local function getTargetQueueList(queueMetaKey, waitKey, pausedKey)
|
|
68
68
|
end
|
69
69
|
end
|
70
70
|
local function moveParentToWait(parentPrefix, parentId, emitEvent)
|
71
|
-
local parentTarget, isPaused = getTargetQueueList(parentPrefix .. "meta", parentPrefix .. "wait",
|
71
|
+
local parentTarget, isPaused = getTargetQueueList(parentPrefix .. "meta", parentPrefix .. "wait",
|
72
|
+
parentPrefix .. "paused")
|
72
73
|
addJobInTargetList(parentTarget, parentPrefix .. "marker", "RPUSH", isPaused, parentId)
|
73
74
|
if emitEvent then
|
74
75
|
local parentEventStream = parentPrefix .. "events"
|
@@ -102,7 +103,8 @@ local function removeParentDependencyKey(jobKey, hard, parentKey, baseKey)
|
|
102
103
|
end
|
103
104
|
else
|
104
105
|
local missedParentKey = rcall("HGET", jobKey, "parentKey")
|
105
|
-
if( (type(missedParentKey) == "string") and missedParentKey ~= ""
|
106
|
+
if( (type(missedParentKey) == "string") and missedParentKey ~= ""
|
107
|
+
and (rcall("EXISTS", missedParentKey) == 1)) then
|
106
108
|
local parentDependenciesKey = missedParentKey .. ":dependencies"
|
107
109
|
local result = rcall("SREM", parentDependenciesKey, jobKey)
|
108
110
|
if result > 0 then
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"obliterate-2.js","sourceRoot":"","sources":["../../../src/scripts/obliterate-2.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG
|
1
|
+
{"version":3,"file":"obliterate-2.js","sourceRoot":"","sources":["../../../src/scripts/obliterate-2.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiQf,CAAC;AACF,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,YAAY;IAClB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
|
@@ -36,7 +36,7 @@ local function addDelayMarkerIfNeeded(markerKey, delayedKey)
|
|
36
36
|
if nextTimestamp ~= nil then
|
37
37
|
-- Replace the score of the marker with the newest known
|
38
38
|
-- next timestamp.
|
39
|
-
rcall("ZADD", markerKey, nextTimestamp, "
|
39
|
+
rcall("ZADD", markerKey, nextTimestamp, "1")
|
40
40
|
end
|
41
41
|
end
|
42
42
|
local markerKey = KEYS[7]
|
@@ -127,7 +127,8 @@ local function getTargetQueueList(queueMetaKey, waitKey, pausedKey)
|
|
127
127
|
end
|
128
128
|
end
|
129
129
|
local function moveParentToWait(parentPrefix, parentId, emitEvent)
|
130
|
-
local parentTarget, isPaused = getTargetQueueList(parentPrefix .. "meta", parentPrefix .. "wait",
|
130
|
+
local parentTarget, isPaused = getTargetQueueList(parentPrefix .. "meta", parentPrefix .. "wait",
|
131
|
+
parentPrefix .. "paused")
|
131
132
|
addJobInTargetList(parentTarget, parentPrefix .. "marker", "RPUSH", isPaused, parentId)
|
132
133
|
if emitEvent then
|
133
134
|
local parentEventStream = parentPrefix .. "events"
|
@@ -161,7 +162,8 @@ local function removeParentDependencyKey(jobKey, hard, parentKey, baseKey)
|
|
161
162
|
end
|
162
163
|
else
|
163
164
|
local missedParentKey = rcall("HGET", jobKey, "parentKey")
|
164
|
-
if( (type(missedParentKey) == "string") and missedParentKey ~= ""
|
165
|
+
if( (type(missedParentKey) == "string") and missedParentKey ~= ""
|
166
|
+
and (rcall("EXISTS", missedParentKey) == 1)) then
|
165
167
|
local parentDependenciesKey = missedParentKey .. ":dependencies"
|
166
168
|
local result = rcall("SREM", parentDependenciesKey, jobKey)
|
167
169
|
if result > 0 then
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"removeJob-1.js","sourceRoot":"","sources":["../../../src/scripts/removeJob-1.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG
|
1
|
+
{"version":3,"file":"removeJob-1.js","sourceRoot":"","sources":["../../../src/scripts/removeJob-1.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuOf,CAAC;AACF,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,WAAW;IACjB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
|