bullmq 5.7.14 → 5.8.0
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/queue-getters.js +12 -0
- package/dist/cjs/classes/queue-getters.js.map +1 -1
- package/dist/cjs/classes/scripts.js +13 -0
- package/dist/cjs/classes/scripts.js.map +1 -1
- package/dist/cjs/commands/getCountsPerPriority-2.lua +25 -0
- package/dist/cjs/commands/includes/addDelayMarkerIfNeeded.lua +6 -6
- package/dist/cjs/commands/includes/prepareJobForProcessing.lua +5 -2
- package/dist/cjs/scripts/addDelayedJob-6.js +6 -6
- package/dist/cjs/scripts/addParentJob-4.js +6 -6
- package/dist/cjs/scripts/addPrioritizedJob-7.js +6 -6
- package/dist/cjs/scripts/addStandardJob-7.js +6 -6
- package/dist/cjs/scripts/changeDelay-4.js +6 -6
- package/dist/cjs/scripts/getCountsPerPriority-2.js +31 -0
- package/dist/cjs/scripts/getCountsPerPriority-2.js.map +1 -0
- package/dist/cjs/scripts/index.js +1 -0
- package/dist/cjs/scripts/index.js.map +1 -1
- package/dist/cjs/scripts/moveStalledJobsToWait-9.js +6 -6
- package/dist/cjs/scripts/moveToActive-11.js +4 -2
- package/dist/cjs/scripts/moveToActive-11.js.map +1 -1
- package/dist/cjs/scripts/moveToDelayed-8.js +6 -6
- package/dist/cjs/scripts/moveToFinished-14.js +10 -8
- package/dist/cjs/scripts/moveToFinished-14.js.map +1 -1
- package/dist/cjs/scripts/pause-7.js +6 -6
- package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/esm/classes/queue-getters.d.ts +6 -0
- package/dist/esm/classes/queue-getters.js +12 -0
- package/dist/esm/classes/queue-getters.js.map +1 -1
- package/dist/esm/classes/scripts.d.ts +2 -0
- package/dist/esm/classes/scripts.js +13 -0
- package/dist/esm/classes/scripts.js.map +1 -1
- package/dist/esm/commands/getCountsPerPriority-2.lua +25 -0
- package/dist/esm/commands/includes/addDelayMarkerIfNeeded.lua +6 -6
- package/dist/esm/commands/includes/prepareJobForProcessing.lua +5 -2
- package/dist/esm/scripts/addDelayedJob-6.js +6 -6
- package/dist/esm/scripts/addParentJob-4.js +6 -6
- package/dist/esm/scripts/addPrioritizedJob-7.js +6 -6
- package/dist/esm/scripts/addStandardJob-7.js +6 -6
- package/dist/esm/scripts/changeDelay-4.js +6 -6
- package/dist/esm/scripts/getCountsPerPriority-2.d.ts +5 -0
- package/dist/esm/scripts/getCountsPerPriority-2.js +28 -0
- package/dist/esm/scripts/getCountsPerPriority-2.js.map +1 -0
- package/dist/esm/scripts/index.d.ts +1 -0
- package/dist/esm/scripts/index.js +1 -0
- package/dist/esm/scripts/index.js.map +1 -1
- package/dist/esm/scripts/moveStalledJobsToWait-9.js +6 -6
- package/dist/esm/scripts/moveToActive-11.js +4 -2
- package/dist/esm/scripts/moveToActive-11.js.map +1 -1
- package/dist/esm/scripts/moveToDelayed-8.js +6 -6
- package/dist/esm/scripts/moveToFinished-14.js +10 -8
- package/dist/esm/scripts/moveToFinished-14.js.map +1 -1
- package/dist/esm/scripts/pause-7.js +6 -6
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -0,0 +1,25 @@
|
|
1
|
+
--[[
|
2
|
+
Get counts per provided states
|
3
|
+
|
4
|
+
Input:
|
5
|
+
KEYS[1] wait key
|
6
|
+
KEYS[2] prioritized key
|
7
|
+
|
8
|
+
ARGV[1...] priorities
|
9
|
+
]]
|
10
|
+
local rcall = redis.call
|
11
|
+
local results = {}
|
12
|
+
local waitKey = KEYS[1]
|
13
|
+
local prioritizedKey = KEYS[2]
|
14
|
+
|
15
|
+
for i = 1, #ARGV do
|
16
|
+
local priority = tonumber(ARGV[i])
|
17
|
+
if priority == 0 then
|
18
|
+
results[#results+1] = rcall("LLEN", waitKey)
|
19
|
+
else
|
20
|
+
results[#results+1] = rcall("ZCOUNT", prioritizedKey,
|
21
|
+
priority * 0x100000000, (priority + 1) * 0x100000000 - 1)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
return results
|
@@ -6,10 +6,10 @@
|
|
6
6
|
--- @include "getNextDelayedTimestamp"
|
7
7
|
|
8
8
|
local function addDelayMarkerIfNeeded(markerKey, delayedKey)
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
9
|
+
local nextTimestamp = getNextDelayedTimestamp(delayedKey)
|
10
|
+
if nextTimestamp ~= nil then
|
11
|
+
-- Replace the score of the marker with the newest known
|
12
|
+
-- next timestamp.
|
13
|
+
rcall("ZADD", markerKey, nextTimestamp, "1")
|
14
|
+
end
|
15
15
|
end
|
@@ -29,13 +29,16 @@ local function prepareJobForProcessing(keyPrefix, rateLimiterKey, eventStreamKey
|
|
29
29
|
rcall("SET", lockKey, opts['token'], "PX", opts['lockDuration'])
|
30
30
|
end
|
31
31
|
|
32
|
+
local optionalValues = {}
|
33
|
+
|
32
34
|
if opts['name'] then
|
33
35
|
-- Set "processedBy" field to the worker name
|
34
|
-
|
36
|
+
table.insert(optionalValues, "pb")
|
37
|
+
table.insert(optionalValues, opts['name'])
|
35
38
|
end
|
36
39
|
|
37
40
|
rcall("XADD", eventStreamKey, "*", "event", "active", "jobId", jobId, "prev", "waiting")
|
38
|
-
rcall("
|
41
|
+
rcall("HMSET", jobKey, "processedOn", processedOn, unpack(optionalValues))
|
39
42
|
rcall("HINCRBY", jobKey, "ats", 1)
|
40
43
|
|
41
44
|
return {rcall("HGETALL", jobKey), jobId, 0, 0} -- get job data
|
@@ -61,12 +61,12 @@ local function getNextDelayedTimestamp(delayedKey)
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
local function addDelayMarkerIfNeeded(markerKey, delayedKey)
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
64
|
+
local nextTimestamp = getNextDelayedTimestamp(delayedKey)
|
65
|
+
if nextTimestamp ~= nil then
|
66
|
+
-- Replace the score of the marker with the newest known
|
67
|
+
-- next timestamp.
|
68
|
+
rcall("ZADD", markerKey, nextTimestamp, "1")
|
69
|
+
end
|
70
70
|
end
|
71
71
|
--[[
|
72
72
|
Function to get max events value or set by default 10000.
|
@@ -87,12 +87,12 @@ local function getNextDelayedTimestamp(delayedKey)
|
|
87
87
|
end
|
88
88
|
end
|
89
89
|
local function addDelayMarkerIfNeeded(markerKey, delayedKey)
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
90
|
+
local nextTimestamp = getNextDelayedTimestamp(delayedKey)
|
91
|
+
if nextTimestamp ~= nil then
|
92
|
+
-- Replace the score of the marker with the newest known
|
93
|
+
-- next timestamp.
|
94
|
+
rcall("ZADD", markerKey, nextTimestamp, "1")
|
95
|
+
end
|
96
96
|
end
|
97
97
|
--[[
|
98
98
|
Function to add job in target list and add marker if needed.
|
@@ -135,12 +135,12 @@ local function getNextDelayedTimestamp(delayedKey)
|
|
135
135
|
end
|
136
136
|
end
|
137
137
|
local function addDelayMarkerIfNeeded(markerKey, delayedKey)
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
138
|
+
local nextTimestamp = getNextDelayedTimestamp(delayedKey)
|
139
|
+
if nextTimestamp ~= nil then
|
140
|
+
-- Replace the score of the marker with the newest known
|
141
|
+
-- next timestamp.
|
142
|
+
rcall("ZADD", markerKey, nextTimestamp, "1")
|
143
|
+
end
|
144
144
|
end
|
145
145
|
--[[
|
146
146
|
Function to add job in target list and add marker if needed.
|
@@ -123,12 +123,12 @@ local function getNextDelayedTimestamp(delayedKey)
|
|
123
123
|
end
|
124
124
|
end
|
125
125
|
local function addDelayMarkerIfNeeded(markerKey, delayedKey)
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
126
|
+
local nextTimestamp = getNextDelayedTimestamp(delayedKey)
|
127
|
+
if nextTimestamp ~= nil then
|
128
|
+
-- Replace the score of the marker with the newest known
|
129
|
+
-- next timestamp.
|
130
|
+
rcall("ZADD", markerKey, nextTimestamp, "1")
|
131
|
+
end
|
132
132
|
end
|
133
133
|
--[[
|
134
134
|
Function to add job considering priority.
|
@@ -36,12 +36,12 @@ local function getNextDelayedTimestamp(delayedKey)
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
local function addDelayMarkerIfNeeded(markerKey, delayedKey)
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
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
45
|
end
|
46
46
|
--[[
|
47
47
|
Function to get max events value or set by default 10000.
|
@@ -0,0 +1,28 @@
|
|
1
|
+
const content = `--[[
|
2
|
+
Get counts per provided states
|
3
|
+
Input:
|
4
|
+
KEYS[1] wait key
|
5
|
+
KEYS[2] prioritized key
|
6
|
+
ARGV[1...] priorities
|
7
|
+
]]
|
8
|
+
local rcall = redis.call
|
9
|
+
local results = {}
|
10
|
+
local waitKey = KEYS[1]
|
11
|
+
local prioritizedKey = KEYS[2]
|
12
|
+
for i = 1, #ARGV do
|
13
|
+
local priority = tonumber(ARGV[i])
|
14
|
+
if priority == 0 then
|
15
|
+
results[#results+1] = rcall("LLEN", waitKey)
|
16
|
+
else
|
17
|
+
results[#results+1] = rcall("ZCOUNT", prioritizedKey,
|
18
|
+
priority * 0x100000000, (priority + 1) * 0x100000000 - 1)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
return results
|
22
|
+
`;
|
23
|
+
export const getCountsPerPriority = {
|
24
|
+
name: 'getCountsPerPriority',
|
25
|
+
content,
|
26
|
+
keys: 2,
|
27
|
+
};
|
28
|
+
//# sourceMappingURL=getCountsPerPriority-2.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getCountsPerPriority-2.js","sourceRoot":"","sources":["../../../src/scripts/getCountsPerPriority-2.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;CAqBf,CAAC;AACF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,IAAI,EAAE,sBAAsB;IAC5B,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
|
@@ -9,6 +9,7 @@ export * from './cleanJobsInSet-2';
|
|
9
9
|
export * from './drain-4';
|
10
10
|
export * from './extendLock-2';
|
11
11
|
export * from './getCounts-1';
|
12
|
+
export * from './getCountsPerPriority-2';
|
12
13
|
export * from './getRanges-1';
|
13
14
|
export * from './getState-8';
|
14
15
|
export * from './getStateV2-8';
|
@@ -9,6 +9,7 @@ export * from './cleanJobsInSet-2';
|
|
9
9
|
export * from './drain-4';
|
10
10
|
export * from './extendLock-2';
|
11
11
|
export * from './getCounts-1';
|
12
|
+
export * from './getCountsPerPriority-2';
|
12
13
|
export * from './getRanges-1';
|
13
14
|
export * from './getState-8';
|
14
15
|
export * from './getStateV2-8';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/scripts/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/scripts/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC"}
|
@@ -88,12 +88,12 @@ local function getNextDelayedTimestamp(delayedKey)
|
|
88
88
|
end
|
89
89
|
end
|
90
90
|
local function addDelayMarkerIfNeeded(markerKey, delayedKey)
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
91
|
+
local nextTimestamp = getNextDelayedTimestamp(delayedKey)
|
92
|
+
if nextTimestamp ~= nil then
|
93
|
+
-- Replace the score of the marker with the newest known
|
94
|
+
-- next timestamp.
|
95
|
+
rcall("ZADD", markerKey, nextTimestamp, "1")
|
96
|
+
end
|
97
97
|
end
|
98
98
|
--[[
|
99
99
|
Function to add job considering priority.
|
@@ -110,12 +110,14 @@ local function prepareJobForProcessing(keyPrefix, rateLimiterKey, eventStreamKey
|
|
110
110
|
if opts['token'] ~= "0" then
|
111
111
|
rcall("SET", lockKey, opts['token'], "PX", opts['lockDuration'])
|
112
112
|
end
|
113
|
+
local optionalValues = {}
|
113
114
|
if opts['name'] then
|
114
115
|
-- Set "processedBy" field to the worker name
|
115
|
-
|
116
|
+
table.insert(optionalValues, "pb")
|
117
|
+
table.insert(optionalValues, opts['name'])
|
116
118
|
end
|
117
119
|
rcall("XADD", eventStreamKey, "*", "event", "active", "jobId", jobId, "prev", "waiting")
|
118
|
-
rcall("
|
120
|
+
rcall("HMSET", jobKey, "processedOn", processedOn, unpack(optionalValues))
|
119
121
|
rcall("HINCRBY", jobKey, "ats", 1)
|
120
122
|
return {rcall("HGETALL", jobKey), jobId, 0, 0} -- get job data
|
121
123
|
end
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"moveToActive-11.js","sourceRoot":"","sources":["../../../src/scripts/moveToActive-11.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG
|
1
|
+
{"version":3,"file":"moveToActive-11.js","sourceRoot":"","sources":["../../../src/scripts/moveToActive-11.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoNf,CAAC;AACF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,cAAc;IACpB,OAAO;IACP,IAAI,EAAE,EAAE;CACT,CAAC"}
|
@@ -43,12 +43,12 @@ local function getNextDelayedTimestamp(delayedKey)
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
local function addDelayMarkerIfNeeded(markerKey, delayedKey)
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
46
|
+
local nextTimestamp = getNextDelayedTimestamp(delayedKey)
|
47
|
+
if nextTimestamp ~= nil then
|
48
|
+
-- Replace the score of the marker with the newest known
|
49
|
+
-- next timestamp.
|
50
|
+
rcall("ZADD", markerKey, nextTimestamp, "1")
|
51
|
+
end
|
52
52
|
end
|
53
53
|
--[[
|
54
54
|
Function to get max events value or set by default 10000.
|
@@ -165,12 +165,12 @@ end
|
|
165
165
|
]]
|
166
166
|
-- Includes
|
167
167
|
local function addDelayMarkerIfNeeded(markerKey, delayedKey)
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
168
|
+
local nextTimestamp = getNextDelayedTimestamp(delayedKey)
|
169
|
+
if nextTimestamp ~= nil then
|
170
|
+
-- Replace the score of the marker with the newest known
|
171
|
+
-- next timestamp.
|
172
|
+
rcall("ZADD", markerKey, nextTimestamp, "1")
|
173
|
+
end
|
174
174
|
end
|
175
175
|
--[[
|
176
176
|
Function to add job in target list and add marker if needed.
|
@@ -296,12 +296,14 @@ local function prepareJobForProcessing(keyPrefix, rateLimiterKey, eventStreamKey
|
|
296
296
|
if opts['token'] ~= "0" then
|
297
297
|
rcall("SET", lockKey, opts['token'], "PX", opts['lockDuration'])
|
298
298
|
end
|
299
|
+
local optionalValues = {}
|
299
300
|
if opts['name'] then
|
300
301
|
-- Set "processedBy" field to the worker name
|
301
|
-
|
302
|
+
table.insert(optionalValues, "pb")
|
303
|
+
table.insert(optionalValues, opts['name'])
|
302
304
|
end
|
303
305
|
rcall("XADD", eventStreamKey, "*", "event", "active", "jobId", jobId, "prev", "waiting")
|
304
|
-
rcall("
|
306
|
+
rcall("HMSET", jobKey, "processedOn", processedOn, unpack(optionalValues))
|
305
307
|
rcall("HINCRBY", jobKey, "ats", 1)
|
306
308
|
return {rcall("HGETALL", jobKey), jobId, 0, 0} -- get job data
|
307
309
|
end
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwqBf,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,gBAAgB;IACtB,OAAO;IACP,IAAI,EAAE,EAAE;CACT,CAAC"}
|
@@ -32,12 +32,12 @@ local function getNextDelayedTimestamp(delayedKey)
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
local function addDelayMarkerIfNeeded(markerKey, delayedKey)
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
35
|
+
local nextTimestamp = getNextDelayedTimestamp(delayedKey)
|
36
|
+
if nextTimestamp ~= nil then
|
37
|
+
-- Replace the score of the marker with the newest known
|
38
|
+
-- next timestamp.
|
39
|
+
rcall("ZADD", markerKey, nextTimestamp, "1")
|
40
|
+
end
|
41
41
|
end
|
42
42
|
local markerKey = KEYS[7]
|
43
43
|
local hasJobs = rcall("EXISTS", KEYS[1]) == 1
|