bullmq 5.8.4 → 5.8.6
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/job.js +6 -3
- package/dist/cjs/classes/job.js.map +1 -1
- package/dist/cjs/classes/scripts.js +2 -25
- package/dist/cjs/classes/scripts.js.map +1 -1
- package/dist/cjs/commands/addDelayedJob-6.lua +2 -3
- package/dist/cjs/commands/changeDelay-4.lua +6 -4
- package/dist/cjs/commands/includes/getDelayedScore.lua +25 -0
- package/dist/cjs/commands/includes/getNextDelayedTimestamp.lua +2 -3
- package/dist/cjs/commands/includes/handleDuplicatedJob.lua +1 -1
- package/dist/cjs/commands/includes/promoteDelayedJobs.lua +1 -1
- package/dist/cjs/commands/moveToDelayed-8.lua +13 -13
- package/dist/cjs/scripts/addDelayedJob-6.js +28 -7
- package/dist/cjs/scripts/addDelayedJob-6.js.map +1 -1
- package/dist/cjs/scripts/addParentJob-4.js +3 -4
- package/dist/cjs/scripts/addParentJob-4.js.map +1 -1
- package/dist/cjs/scripts/addPrioritizedJob-7.js +3 -4
- package/dist/cjs/scripts/addPrioritizedJob-7.js.map +1 -1
- package/dist/cjs/scripts/addStandardJob-7.js +3 -4
- package/dist/cjs/scripts/addStandardJob-7.js.map +1 -1
- package/dist/cjs/scripts/changeDelay-4.js +30 -7
- package/dist/cjs/scripts/changeDelay-4.js.map +1 -1
- package/dist/cjs/scripts/moveStalledJobsToWait-9.js +2 -3
- package/dist/cjs/scripts/moveStalledJobsToWait-9.js.map +1 -1
- package/dist/cjs/scripts/moveToActive-11.js +3 -4
- package/dist/cjs/scripts/moveToActive-11.js.map +1 -1
- package/dist/cjs/scripts/moveToDelayed-8.js +37 -15
- package/dist/cjs/scripts/moveToDelayed-8.js.map +1 -1
- package/dist/cjs/scripts/moveToFinished-14.js +3 -4
- package/dist/cjs/scripts/moveToFinished-14.js.map +1 -1
- package/dist/cjs/scripts/pause-7.js +2 -3
- package/dist/cjs/scripts/pause-7.js.map +1 -1
- package/dist/cjs/scripts/retryJob-11.js +1 -1
- package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/esm/classes/job.js +6 -3
- package/dist/esm/classes/job.js.map +1 -1
- package/dist/esm/classes/scripts.d.ts +1 -1
- package/dist/esm/classes/scripts.js +2 -25
- package/dist/esm/classes/scripts.js.map +1 -1
- package/dist/esm/commands/addDelayedJob-6.lua +2 -3
- package/dist/esm/commands/changeDelay-4.lua +6 -4
- package/dist/esm/commands/includes/getDelayedScore.lua +25 -0
- package/dist/esm/commands/includes/getNextDelayedTimestamp.lua +2 -3
- package/dist/esm/commands/includes/handleDuplicatedJob.lua +1 -1
- package/dist/esm/commands/includes/promoteDelayedJobs.lua +1 -1
- package/dist/esm/commands/moveToDelayed-8.lua +13 -13
- package/dist/esm/scripts/addDelayedJob-6.js +28 -7
- package/dist/esm/scripts/addDelayedJob-6.js.map +1 -1
- package/dist/esm/scripts/addParentJob-4.js +3 -4
- package/dist/esm/scripts/addParentJob-4.js.map +1 -1
- package/dist/esm/scripts/addPrioritizedJob-7.js +3 -4
- package/dist/esm/scripts/addPrioritizedJob-7.js.map +1 -1
- package/dist/esm/scripts/addStandardJob-7.js +3 -4
- package/dist/esm/scripts/addStandardJob-7.js.map +1 -1
- package/dist/esm/scripts/changeDelay-4.js +30 -7
- package/dist/esm/scripts/changeDelay-4.js.map +1 -1
- package/dist/esm/scripts/moveStalledJobsToWait-9.js +2 -3
- package/dist/esm/scripts/moveStalledJobsToWait-9.js.map +1 -1
- package/dist/esm/scripts/moveToActive-11.js +3 -4
- package/dist/esm/scripts/moveToActive-11.js.map +1 -1
- package/dist/esm/scripts/moveToDelayed-8.js +37 -15
- package/dist/esm/scripts/moveToDelayed-8.js.map +1 -1
- package/dist/esm/scripts/moveToFinished-14.js +3 -4
- package/dist/esm/scripts/moveToFinished-14.js.map +1 -1
- package/dist/esm/scripts/pause-7.js +2 -3
- package/dist/esm/scripts/pause-7.js.map +1 -1
- package/dist/esm/scripts/retryJob-11.js +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -119,10 +119,9 @@ local function getNextDelayedTimestamp(delayedKey)
|
|
119
119
|
local result = rcall("ZRANGE", delayedKey, 0, 0, "WITHSCORES")
|
120
120
|
if #result then
|
121
121
|
local nextTimestamp = tonumber(result[2])
|
122
|
-
if
|
123
|
-
|
122
|
+
if nextTimestamp ~= nil then
|
123
|
+
return nextTimestamp / 0x1000
|
124
124
|
end
|
125
|
-
return nextTimestamp
|
126
125
|
end
|
127
126
|
end
|
128
127
|
local function addDelayMarkerIfNeeded(markerKey, delayedKey)
|
@@ -214,7 +213,7 @@ end
|
|
214
213
|
local function handleDuplicatedJob(jobKey, jobId, currentParentKey, currentParent,
|
215
214
|
parentData, parentDependenciesKey, completedKey, eventsKey, maxEvents, timestamp)
|
216
215
|
local existedParentKey = rcall("HGET", jobKey, "parentKey")
|
217
|
-
if not existedParentKey then
|
216
|
+
if not existedParentKey or existedParentKey == currentParentKey then
|
218
217
|
updateExistingJobsParent(currentParentKey, currentParent, parentData,
|
219
218
|
parentDependenciesKey, completedKey, jobKey,
|
220
219
|
jobId, timestamp)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"addStandardJob-7.js","sourceRoot":"","sources":["../../../src/scripts/addStandardJob-7.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG
|
1
|
+
{"version":3,"file":"addStandardJob-7.js","sourceRoot":"","sources":["../../../src/scripts/addStandardJob-7.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+Rf,CAAC;AACW,QAAA,cAAc,GAAG;IAC5B,IAAI,EAAE,gBAAgB;IACtB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
|
@@ -9,7 +9,7 @@ const content = `--[[
|
|
9
9
|
KEYS[3] marker key
|
10
10
|
KEYS[4] events stream
|
11
11
|
ARGV[1] delay
|
12
|
-
ARGV[2]
|
12
|
+
ARGV[2] timestamp
|
13
13
|
ARGV[3] the id of the job
|
14
14
|
ARGV[4] job key
|
15
15
|
Output:
|
@@ -32,10 +32,9 @@ local function getNextDelayedTimestamp(delayedKey)
|
|
32
32
|
local result = rcall("ZRANGE", delayedKey, 0, 0, "WITHSCORES")
|
33
33
|
if #result then
|
34
34
|
local nextTimestamp = tonumber(result[2])
|
35
|
-
if
|
36
|
-
|
35
|
+
if nextTimestamp ~= nil then
|
36
|
+
return nextTimestamp / 0x1000
|
37
37
|
end
|
38
|
-
return nextTimestamp
|
39
38
|
end
|
40
39
|
end
|
41
40
|
local function addDelayMarkerIfNeeded(markerKey, delayedKey)
|
@@ -46,6 +45,30 @@ local function addDelayMarkerIfNeeded(markerKey, delayedKey)
|
|
46
45
|
rcall("ZADD", markerKey, nextTimestamp, "1")
|
47
46
|
end
|
48
47
|
end
|
48
|
+
--[[
|
49
|
+
Bake in the job id first 12 bits into the timestamp
|
50
|
+
to guarantee correct execution order of delayed jobs
|
51
|
+
(up to 4096 jobs per given timestamp or 4096 jobs apart per timestamp)
|
52
|
+
WARNING: Jobs that are so far apart that they wrap around will cause FIFO to fail
|
53
|
+
]]
|
54
|
+
local function getDelayedScore(delayedKey, timestamp, delay)
|
55
|
+
local delayedTimestamp = (delay > 0 and (tonumber(timestamp) + delay)) or tonumber(timestamp)
|
56
|
+
local minScore = delayedTimestamp * 0x1000
|
57
|
+
local maxScore = (delayedTimestamp + 1 ) * 0x1000 - 1
|
58
|
+
local result = rcall("ZREVRANGEBYSCORE", delayedKey, maxScore,
|
59
|
+
minScore, "WITHSCORES","LIMIT", 0, 1)
|
60
|
+
if #result then
|
61
|
+
local currentMaxScore = tonumber(result[2])
|
62
|
+
if currentMaxScore ~= nil then
|
63
|
+
if currentMaxScore >= maxScore then
|
64
|
+
return maxScore, delayedTimestamp
|
65
|
+
else
|
66
|
+
return currentMaxScore + 1, delayedTimestamp
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
return minScore, delayedTimestamp
|
71
|
+
end
|
49
72
|
--[[
|
50
73
|
Function to get max events value or set by default 10000.
|
51
74
|
]]
|
@@ -66,13 +89,13 @@ local function isQueuePaused(queueMetaKey)
|
|
66
89
|
end
|
67
90
|
if rcall("EXISTS", ARGV[4]) == 1 then
|
68
91
|
local jobId = ARGV[3]
|
69
|
-
local
|
70
|
-
local delayedTimestamp = (
|
92
|
+
local delay = tonumber(ARGV[1])
|
93
|
+
local score, delayedTimestamp = getDelayedScore(KEYS[1], ARGV[2], delay)
|
71
94
|
local numRemovedElements = rcall("ZREM", KEYS[1], jobId)
|
72
95
|
if numRemovedElements < 1 then
|
73
96
|
return -3
|
74
97
|
end
|
75
|
-
rcall("HSET", ARGV[4], "delay",
|
98
|
+
rcall("HSET", ARGV[4], "delay", delay)
|
76
99
|
rcall("ZADD", KEYS[1], score, jobId)
|
77
100
|
local maxEvents = getOrSetMaxEvents(KEYS[2])
|
78
101
|
rcall("XADD", KEYS[4], "MAXLEN", "~", maxEvents, "*", "event", "delayed",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"changeDelay-4.js","sourceRoot":"","sources":["../../../src/scripts/changeDelay-4.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG
|
1
|
+
{"version":3,"file":"changeDelay-4.js","sourceRoot":"","sources":["../../../src/scripts/changeDelay-4.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2GZ,CAAC;AACQ,QAAA,WAAW,GAAG;IACzB,IAAI,EAAE,aAAa;IACnB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
|
@@ -84,10 +84,9 @@ local function getNextDelayedTimestamp(delayedKey)
|
|
84
84
|
local result = rcall("ZRANGE", delayedKey, 0, 0, "WITHSCORES")
|
85
85
|
if #result then
|
86
86
|
local nextTimestamp = tonumber(result[2])
|
87
|
-
if
|
88
|
-
|
87
|
+
if nextTimestamp ~= nil then
|
88
|
+
return nextTimestamp / 0x1000
|
89
89
|
end
|
90
|
-
return nextTimestamp
|
91
90
|
end
|
92
91
|
end
|
93
92
|
local function addDelayMarkerIfNeeded(markerKey, delayedKey)
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA2bS,CAAC;AACb,QAAA,qBAAqB,GAAG;IACnC,IAAI,EAAE,uBAAuB;IAC7B,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
|
@@ -45,10 +45,9 @@ local function getNextDelayedTimestamp(delayedKey)
|
|
45
45
|
local result = rcall("ZRANGE", delayedKey, 0, 0, "WITHSCORES")
|
46
46
|
if #result then
|
47
47
|
local nextTimestamp = tonumber(result[2])
|
48
|
-
if
|
49
|
-
|
48
|
+
if nextTimestamp ~= nil then
|
49
|
+
return nextTimestamp / 0x1000
|
50
50
|
end
|
51
|
-
return nextTimestamp
|
52
51
|
end
|
53
52
|
end
|
54
53
|
--[[
|
@@ -160,7 +159,7 @@ end
|
|
160
159
|
-- Try to get as much as 1000 jobs at once
|
161
160
|
local function promoteDelayedJobs(delayedKey, markerKey, targetKey, prioritizedKey,
|
162
161
|
eventStreamKey, prefix, timestamp, priorityCounterKey, isPaused)
|
163
|
-
local jobs = rcall("ZRANGEBYSCORE", delayedKey, 0, (timestamp + 1) * 0x1000, "LIMIT", 0, 1000)
|
162
|
+
local jobs = rcall("ZRANGEBYSCORE", delayedKey, 0, (timestamp + 1) * 0x1000 - 1, "LIMIT", 0, 1000)
|
164
163
|
if (#jobs > 0) then
|
165
164
|
rcall("ZREM", delayedKey, unpack(jobs))
|
166
165
|
for _, jobId in ipairs(jobs) do
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmNf,CAAC;AACW,QAAA,YAAY,GAAG;IAC1B,IAAI,EAAE,cAAc;IACpB,OAAO;IACP,IAAI,EAAE,EAAE;CACT,CAAC"}
|
@@ -14,11 +14,10 @@ const content = `--[[
|
|
14
14
|
KEYS[8] stalled key
|
15
15
|
ARGV[1] key prefix
|
16
16
|
ARGV[2] timestamp
|
17
|
-
ARGV[3]
|
18
|
-
ARGV[4]
|
19
|
-
ARGV[5]
|
20
|
-
ARGV[6]
|
21
|
-
ARGV[7] skip attempt
|
17
|
+
ARGV[3] the id of the job
|
18
|
+
ARGV[4] queue token
|
19
|
+
ARGV[5] delay value
|
20
|
+
ARGV[6] skip attempt
|
22
21
|
Output:
|
23
22
|
0 - OK
|
24
23
|
-1 - Missing job.
|
@@ -39,10 +38,9 @@ local function getNextDelayedTimestamp(delayedKey)
|
|
39
38
|
local result = rcall("ZRANGE", delayedKey, 0, 0, "WITHSCORES")
|
40
39
|
if #result then
|
41
40
|
local nextTimestamp = tonumber(result[2])
|
42
|
-
if
|
43
|
-
|
41
|
+
if nextTimestamp ~= nil then
|
42
|
+
return nextTimestamp / 0x1000
|
44
43
|
end
|
45
|
-
return nextTimestamp
|
46
44
|
end
|
47
45
|
end
|
48
46
|
local function addDelayMarkerIfNeeded(markerKey, delayedKey)
|
@@ -53,6 +51,30 @@ local function addDelayMarkerIfNeeded(markerKey, delayedKey)
|
|
53
51
|
rcall("ZADD", markerKey, nextTimestamp, "1")
|
54
52
|
end
|
55
53
|
end
|
54
|
+
--[[
|
55
|
+
Bake in the job id first 12 bits into the timestamp
|
56
|
+
to guarantee correct execution order of delayed jobs
|
57
|
+
(up to 4096 jobs per given timestamp or 4096 jobs apart per timestamp)
|
58
|
+
WARNING: Jobs that are so far apart that they wrap around will cause FIFO to fail
|
59
|
+
]]
|
60
|
+
local function getDelayedScore(delayedKey, timestamp, delay)
|
61
|
+
local delayedTimestamp = (delay > 0 and (tonumber(timestamp) + delay)) or tonumber(timestamp)
|
62
|
+
local minScore = delayedTimestamp * 0x1000
|
63
|
+
local maxScore = (delayedTimestamp + 1 ) * 0x1000 - 1
|
64
|
+
local result = rcall("ZREVRANGEBYSCORE", delayedKey, maxScore,
|
65
|
+
minScore, "WITHSCORES","LIMIT", 0, 1)
|
66
|
+
if #result then
|
67
|
+
local currentMaxScore = tonumber(result[2])
|
68
|
+
if currentMaxScore ~= nil then
|
69
|
+
if currentMaxScore >= maxScore then
|
70
|
+
return maxScore, delayedTimestamp
|
71
|
+
else
|
72
|
+
return currentMaxScore + 1, delayedTimestamp
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
return minScore, delayedTimestamp
|
77
|
+
end
|
56
78
|
--[[
|
57
79
|
Function to get max events value or set by default 10000.
|
58
80
|
]]
|
@@ -92,22 +114,22 @@ local function removeLock(jobKey, stalledKey, token, jobId)
|
|
92
114
|
end
|
93
115
|
local jobKey = KEYS[5]
|
94
116
|
local metaKey = KEYS[7]
|
95
|
-
local token = ARGV[
|
117
|
+
local token = ARGV[4]
|
96
118
|
if rcall("EXISTS", jobKey) == 1 then
|
97
|
-
local errorCode = removeLock(jobKey, KEYS[8], token, ARGV[
|
119
|
+
local errorCode = removeLock(jobKey, KEYS[8], token, ARGV[3])
|
98
120
|
if errorCode < 0 then
|
99
121
|
return errorCode
|
100
122
|
end
|
101
123
|
local delayedKey = KEYS[4]
|
102
|
-
local jobId = ARGV[
|
103
|
-
local
|
104
|
-
local delayedTimestamp = (
|
124
|
+
local jobId = ARGV[3]
|
125
|
+
local delay = tonumber(ARGV[5])
|
126
|
+
local score, delayedTimestamp = getDelayedScore(delayedKey, ARGV[2], delay)
|
105
127
|
local numRemovedElements = rcall("LREM", KEYS[2], -1, jobId)
|
106
128
|
if numRemovedElements < 1 then return -3 end
|
107
|
-
if ARGV[
|
129
|
+
if ARGV[6] == "0" then
|
108
130
|
rcall("HINCRBY", jobKey, "atm", 1)
|
109
131
|
end
|
110
|
-
rcall("HSET", jobKey, "delay", ARGV[
|
132
|
+
rcall("HSET", jobKey, "delay", ARGV[5])
|
111
133
|
local maxEvents = getOrSetMaxEvents(metaKey)
|
112
134
|
rcall("ZADD", delayedKey, score, jobId)
|
113
135
|
rcall("XADD", KEYS[6], "MAXLEN", "~", maxEvents, "*", "event", "delayed",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"moveToDelayed-8.js","sourceRoot":"","sources":["../../../src/scripts/moveToDelayed-8.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG
|
1
|
+
{"version":3,"file":"moveToDelayed-8.js","sourceRoot":"","sources":["../../../src/scripts/moveToDelayed-8.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+If,CAAC;AACW,QAAA,aAAa,GAAG;IAC3B,IAAI,EAAE,eAAe;IACrB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
|
@@ -111,10 +111,9 @@ local function getNextDelayedTimestamp(delayedKey)
|
|
111
111
|
local result = rcall("ZRANGE", delayedKey, 0, 0, "WITHSCORES")
|
112
112
|
if #result then
|
113
113
|
local nextTimestamp = tonumber(result[2])
|
114
|
-
if
|
115
|
-
|
114
|
+
if nextTimestamp ~= nil then
|
115
|
+
return nextTimestamp / 0x1000
|
116
116
|
end
|
117
|
-
return nextTimestamp
|
118
117
|
end
|
119
118
|
end
|
120
119
|
--[[
|
@@ -320,7 +319,7 @@ end
|
|
320
319
|
-- Try to get as much as 1000 jobs at once
|
321
320
|
local function promoteDelayedJobs(delayedKey, markerKey, targetKey, prioritizedKey,
|
322
321
|
eventStreamKey, prefix, timestamp, priorityCounterKey, isPaused)
|
323
|
-
local jobs = rcall("ZRANGEBYSCORE", delayedKey, 0, (timestamp + 1) * 0x1000, "LIMIT", 0, 1000)
|
322
|
+
local jobs = rcall("ZRANGEBYSCORE", delayedKey, 0, (timestamp + 1) * 0x1000 - 1, "LIMIT", 0, 1000)
|
324
323
|
if (#jobs > 0) then
|
325
324
|
rcall("ZREM", delayedKey, unpack(jobs))
|
326
325
|
for _, jobId in ipairs(jobs) do
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuqBf,CAAC;AACW,QAAA,cAAc,GAAG;IAC5B,IAAI,EAAE,gBAAgB;IACtB,OAAO;IACP,IAAI,EAAE,EAAE;CACT,CAAC"}
|
@@ -28,10 +28,9 @@ local function getNextDelayedTimestamp(delayedKey)
|
|
28
28
|
local result = rcall("ZRANGE", delayedKey, 0, 0, "WITHSCORES")
|
29
29
|
if #result then
|
30
30
|
local nextTimestamp = tonumber(result[2])
|
31
|
-
if
|
32
|
-
|
31
|
+
if nextTimestamp ~= nil then
|
32
|
+
return nextTimestamp / 0x1000
|
33
33
|
end
|
34
|
-
return nextTimestamp
|
35
34
|
end
|
36
35
|
end
|
37
36
|
local function addDelayMarkerIfNeeded(markerKey, delayedKey)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pause-7.js","sourceRoot":"","sources":["../../../src/scripts/pause-7.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG
|
1
|
+
{"version":3,"file":"pause-7.js","sourceRoot":"","sources":["../../../src/scripts/pause-7.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDf,CAAC;AACW,QAAA,KAAK,GAAG;IACnB,IAAI,EAAE,OAAO;IACb,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
|
@@ -88,7 +88,7 @@ end
|
|
88
88
|
-- Try to get as much as 1000 jobs at once
|
89
89
|
local function promoteDelayedJobs(delayedKey, markerKey, targetKey, prioritizedKey,
|
90
90
|
eventStreamKey, prefix, timestamp, priorityCounterKey, isPaused)
|
91
|
-
local jobs = rcall("ZRANGEBYSCORE", delayedKey, 0, (timestamp + 1) * 0x1000, "LIMIT", 0, 1000)
|
91
|
+
local jobs = rcall("ZRANGEBYSCORE", delayedKey, 0, (timestamp + 1) * 0x1000 - 1, "LIMIT", 0, 1000)
|
92
92
|
if (#jobs > 0) then
|
93
93
|
rcall("ZREM", delayedKey, unpack(jobs))
|
94
94
|
for _, jobId in ipairs(jobs) do
|