bullmq 5.58.8 → 5.59.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/child-pool.js +8 -1
- package/dist/cjs/classes/child-pool.js.map +1 -1
- package/dist/cjs/classes/queue-getters.js +6 -19
- package/dist/cjs/classes/queue-getters.js.map +1 -1
- package/dist/cjs/classes/scripts.js +10 -0
- package/dist/cjs/classes/scripts.js.map +1 -1
- package/dist/cjs/classes/worker.js +42 -30
- package/dist/cjs/classes/worker.js.map +1 -1
- package/dist/cjs/commands/getMetrics-2.lua +19 -0
- package/dist/cjs/commands/includes/deduplicateJob.lua +53 -20
- package/dist/cjs/commands/moveJobFromActiveToWait-9.lua +1 -1
- package/dist/cjs/commands/moveToDelayed-8.lua +2 -1
- package/dist/cjs/scripts/addDelayedJob-6.js +47 -18
- package/dist/cjs/scripts/addDelayedJob-6.js.map +1 -1
- package/dist/cjs/scripts/addParentJob-5.js +47 -18
- package/dist/cjs/scripts/addParentJob-5.js.map +1 -1
- package/dist/cjs/scripts/addPrioritizedJob-9.js +47 -18
- package/dist/cjs/scripts/addPrioritizedJob-9.js.map +1 -1
- package/dist/cjs/scripts/addStandardJob-9.js +47 -18
- package/dist/cjs/scripts/addStandardJob-9.js.map +1 -1
- package/dist/cjs/scripts/getMetrics-2.js +25 -0
- package/dist/cjs/scripts/getMetrics-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/moveJobFromActiveToWait-9.js +1 -1
- package/dist/cjs/scripts/moveToDelayed-8.js +1 -1
- package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/classes/child-pool.js +8 -1
- package/dist/esm/classes/child-pool.js.map +1 -1
- package/dist/esm/classes/queue-getters.js +6 -19
- package/dist/esm/classes/queue-getters.js.map +1 -1
- package/dist/esm/classes/scripts.d.ts +1 -0
- package/dist/esm/classes/scripts.js +10 -0
- package/dist/esm/classes/scripts.js.map +1 -1
- package/dist/esm/classes/worker.d.ts +1 -0
- package/dist/esm/classes/worker.js +42 -30
- package/dist/esm/classes/worker.js.map +1 -1
- package/dist/esm/commands/getMetrics-2.lua +19 -0
- package/dist/esm/commands/includes/deduplicateJob.lua +53 -20
- package/dist/esm/commands/moveJobFromActiveToWait-9.lua +1 -1
- package/dist/esm/commands/moveToDelayed-8.lua +2 -1
- package/dist/esm/interfaces/base-job-options.d.ts +1 -1
- package/dist/esm/interfaces/worker-options.d.ts +8 -0
- package/dist/esm/scripts/addDelayedJob-6.js +47 -18
- package/dist/esm/scripts/addDelayedJob-6.js.map +1 -1
- package/dist/esm/scripts/addParentJob-5.js +47 -18
- package/dist/esm/scripts/addParentJob-5.js.map +1 -1
- package/dist/esm/scripts/addPrioritizedJob-9.js +47 -18
- package/dist/esm/scripts/addPrioritizedJob-9.js.map +1 -1
- package/dist/esm/scripts/addStandardJob-9.js +47 -18
- package/dist/esm/scripts/addStandardJob-9.js.map +1 -1
- package/dist/esm/scripts/getMetrics-2.d.ts +5 -0
- package/dist/esm/scripts/getMetrics-2.js +22 -0
- package/dist/esm/scripts/getMetrics-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/moveJobFromActiveToWait-9.js +1 -1
- package/dist/esm/scripts/moveToDelayed-8.js +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
--[[
|
|
2
|
+
Get metrics
|
|
3
|
+
|
|
4
|
+
Input:
|
|
5
|
+
KEYS[1] 'metrics' key
|
|
6
|
+
KEYS[2] 'metrics data' key
|
|
7
|
+
|
|
8
|
+
ARGV[1] start index
|
|
9
|
+
ARGV[2] end index
|
|
10
|
+
]]
|
|
11
|
+
local rcall = redis.call;
|
|
12
|
+
local metricsKey = KEYS[1]
|
|
13
|
+
local dataKey = KEYS[2]
|
|
14
|
+
|
|
15
|
+
local metrics = rcall("HMGET", metricsKey, "count", "prevTS", "prevCount")
|
|
16
|
+
local data = rcall("LRANGE", dataKey, tonumber(ARGV[1]), tonumber(ARGV[2]))
|
|
17
|
+
local numPoints = rcall("LLEN", dataKey)
|
|
18
|
+
|
|
19
|
+
return {metrics, data, numPoints}
|
|
@@ -3,39 +3,71 @@
|
|
|
3
3
|
]]
|
|
4
4
|
-- Includes
|
|
5
5
|
--- @include "removeJobKeys"
|
|
6
|
+
|
|
7
|
+
local function removeDelayedJob(delayedKey, deduplicationKey, eventsKey, maxEvents, currentDeduplicatedJobId,
|
|
8
|
+
jobId, deduplicationId, prefix)
|
|
9
|
+
if rcall("ZREM", delayedKey, currentDeduplicatedJobId) > 0 then
|
|
10
|
+
removeJobKeys(prefix .. currentDeduplicatedJobId)
|
|
11
|
+
rcall("XADD", eventsKey, "*", "event", "removed", "jobId", currentDeduplicatedJobId,
|
|
12
|
+
"prev", "delayed")
|
|
13
|
+
|
|
14
|
+
-- TODO remove debounced event in next breaking change
|
|
15
|
+
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "debounced", "jobId",
|
|
16
|
+
jobId, "debounceId", deduplicationId)
|
|
17
|
+
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
|
|
18
|
+
jobId, "deduplicationId", deduplicationId, "deduplicatedJobId", currentDeduplicatedJobId)
|
|
19
|
+
|
|
20
|
+
return true
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
return false
|
|
24
|
+
end
|
|
25
|
+
|
|
6
26
|
local function deduplicateJob(deduplicationOpts, jobId, delayedKey, deduplicationKey, eventsKey, maxEvents,
|
|
7
27
|
prefix)
|
|
8
28
|
local deduplicationId = deduplicationOpts and deduplicationOpts['id']
|
|
9
29
|
if deduplicationId then
|
|
10
30
|
local ttl = deduplicationOpts['ttl']
|
|
11
|
-
if deduplicationOpts['replace']
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
31
|
+
if deduplicationOpts['replace'] then
|
|
32
|
+
if ttl and ttl > 0 then
|
|
33
|
+
local currentDebounceJobId = rcall('GET', deduplicationKey)
|
|
34
|
+
if currentDebounceJobId then
|
|
35
|
+
local isRemoved = removeDelayedJob(delayedKey, deduplicationKey, eventsKey, maxEvents,
|
|
36
|
+
currentDebounceJobId, jobId, deduplicationId, prefix)
|
|
37
|
+
if isRemoved then
|
|
38
|
+
if deduplicationOpts['extend'] then
|
|
39
|
+
rcall('SET', deduplicationKey, jobId, 'PX', ttl)
|
|
40
|
+
else
|
|
41
|
+
rcall('SET', deduplicationKey, jobId, 'KEEPTTL')
|
|
42
|
+
end
|
|
43
|
+
return
|
|
21
44
|
else
|
|
22
|
-
|
|
45
|
+
return currentDebounceJobId
|
|
23
46
|
end
|
|
24
|
-
|
|
25
|
-
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
|
|
26
|
-
jobId, "deduplicationId", deduplicationId, "deduplicatedJobId", currentDebounceJobId)
|
|
27
|
-
return
|
|
28
47
|
else
|
|
29
|
-
|
|
48
|
+
rcall('SET', deduplicationKey, jobId, 'PX', ttl)
|
|
49
|
+
return
|
|
30
50
|
end
|
|
31
51
|
else
|
|
32
|
-
rcall('
|
|
33
|
-
|
|
52
|
+
local currentDebounceJobId = rcall('GET', deduplicationKey)
|
|
53
|
+
if currentDebounceJobId then
|
|
54
|
+
local isRemoved = removeDelayedJob(delayedKey, deduplicationKey, eventsKey, maxEvents,
|
|
55
|
+
currentDebounceJobId, jobId, deduplicationId, prefix)
|
|
56
|
+
|
|
57
|
+
if isRemoved then
|
|
58
|
+
rcall('SET', deduplicationKey, jobId)
|
|
59
|
+
return
|
|
60
|
+
else
|
|
61
|
+
return currentDebounceJobId
|
|
62
|
+
end
|
|
63
|
+
else
|
|
64
|
+
rcall('SET', deduplicationKey, jobId)
|
|
65
|
+
return
|
|
66
|
+
end
|
|
34
67
|
end
|
|
35
68
|
else
|
|
36
|
-
local ttl = deduplicationOpts['ttl']
|
|
37
69
|
local deduplicationKeyExists
|
|
38
|
-
if ttl then
|
|
70
|
+
if ttl and ttl > 0 then
|
|
39
71
|
if deduplicationOpts['extend'] then
|
|
40
72
|
local currentDebounceJobId = rcall('GET', deduplicationKey)
|
|
41
73
|
if currentDebounceJobId then
|
|
@@ -58,6 +90,7 @@ local function deduplicateJob(deduplicationOpts, jobId, delayedKey, deduplicatio
|
|
|
58
90
|
|
|
59
91
|
if deduplicationKeyExists then
|
|
60
92
|
local currentDebounceJobId = rcall('GET', deduplicationKey)
|
|
93
|
+
-- TODO remove debounced event in next breaking change
|
|
61
94
|
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "debounced", "jobId",
|
|
62
95
|
currentDebounceJobId, "debounceId", deduplicationId)
|
|
63
96
|
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
|
|
@@ -50,11 +50,12 @@ if rcall("EXISTS", jobKey) == 1 then
|
|
|
50
50
|
local delayedKey = KEYS[4]
|
|
51
51
|
local jobId = ARGV[3]
|
|
52
52
|
local delay = tonumber(ARGV[5])
|
|
53
|
-
local score, delayedTimestamp = getDelayedScore(delayedKey, ARGV[2], delay)
|
|
54
53
|
|
|
55
54
|
local numRemovedElements = rcall("LREM", KEYS[2], -1, jobId)
|
|
56
55
|
if numRemovedElements < 1 then return -3 end
|
|
57
56
|
|
|
57
|
+
local score, delayedTimestamp = getDelayedScore(delayedKey, ARGV[2], delay)
|
|
58
|
+
|
|
58
59
|
if ARGV[6] == "0" then
|
|
59
60
|
rcall("HINCRBY", jobKey, "atm", 1)
|
|
60
61
|
end
|
|
@@ -123,37 +123,65 @@ local function removeJobKeys(jobKey)
|
|
|
123
123
|
return rcall("DEL", jobKey, jobKey .. ':logs', jobKey .. ':dependencies',
|
|
124
124
|
jobKey .. ':processed', jobKey .. ':failed', jobKey .. ':unsuccessful')
|
|
125
125
|
end
|
|
126
|
+
local function removeDelayedJob(delayedKey, deduplicationKey, eventsKey, maxEvents, currentDeduplicatedJobId,
|
|
127
|
+
jobId, deduplicationId, prefix)
|
|
128
|
+
if rcall("ZREM", delayedKey, currentDeduplicatedJobId) > 0 then
|
|
129
|
+
removeJobKeys(prefix .. currentDeduplicatedJobId)
|
|
130
|
+
rcall("XADD", eventsKey, "*", "event", "removed", "jobId", currentDeduplicatedJobId,
|
|
131
|
+
"prev", "delayed")
|
|
132
|
+
-- TODO remove debounced event in next breaking change
|
|
133
|
+
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "debounced", "jobId",
|
|
134
|
+
jobId, "debounceId", deduplicationId)
|
|
135
|
+
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
|
|
136
|
+
jobId, "deduplicationId", deduplicationId, "deduplicatedJobId", currentDeduplicatedJobId)
|
|
137
|
+
return true
|
|
138
|
+
end
|
|
139
|
+
return false
|
|
140
|
+
end
|
|
126
141
|
local function deduplicateJob(deduplicationOpts, jobId, delayedKey, deduplicationKey, eventsKey, maxEvents,
|
|
127
142
|
prefix)
|
|
128
143
|
local deduplicationId = deduplicationOpts and deduplicationOpts['id']
|
|
129
144
|
if deduplicationId then
|
|
130
145
|
local ttl = deduplicationOpts['ttl']
|
|
131
|
-
if deduplicationOpts['replace']
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
if
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
146
|
+
if deduplicationOpts['replace'] then
|
|
147
|
+
if ttl and ttl > 0 then
|
|
148
|
+
local currentDebounceJobId = rcall('GET', deduplicationKey)
|
|
149
|
+
if currentDebounceJobId then
|
|
150
|
+
local isRemoved = removeDelayedJob(delayedKey, deduplicationKey, eventsKey, maxEvents,
|
|
151
|
+
currentDebounceJobId, jobId, deduplicationId, prefix)
|
|
152
|
+
if isRemoved then
|
|
153
|
+
if deduplicationOpts['extend'] then
|
|
154
|
+
rcall('SET', deduplicationKey, jobId, 'PX', ttl)
|
|
155
|
+
else
|
|
156
|
+
rcall('SET', deduplicationKey, jobId, 'KEEPTTL')
|
|
157
|
+
end
|
|
158
|
+
return
|
|
140
159
|
else
|
|
141
|
-
|
|
160
|
+
return currentDebounceJobId
|
|
142
161
|
end
|
|
143
|
-
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
|
|
144
|
-
jobId, "deduplicationId", deduplicationId, "deduplicatedJobId", currentDebounceJobId)
|
|
145
|
-
return
|
|
146
162
|
else
|
|
147
|
-
|
|
163
|
+
rcall('SET', deduplicationKey, jobId, 'PX', ttl)
|
|
164
|
+
return
|
|
148
165
|
end
|
|
149
166
|
else
|
|
150
|
-
rcall('
|
|
151
|
-
|
|
167
|
+
local currentDebounceJobId = rcall('GET', deduplicationKey)
|
|
168
|
+
if currentDebounceJobId then
|
|
169
|
+
local isRemoved = removeDelayedJob(delayedKey, deduplicationKey, eventsKey, maxEvents,
|
|
170
|
+
currentDebounceJobId, jobId, deduplicationId, prefix)
|
|
171
|
+
if isRemoved then
|
|
172
|
+
rcall('SET', deduplicationKey, jobId)
|
|
173
|
+
return
|
|
174
|
+
else
|
|
175
|
+
return currentDebounceJobId
|
|
176
|
+
end
|
|
177
|
+
else
|
|
178
|
+
rcall('SET', deduplicationKey, jobId)
|
|
179
|
+
return
|
|
180
|
+
end
|
|
152
181
|
end
|
|
153
182
|
else
|
|
154
|
-
local ttl = deduplicationOpts['ttl']
|
|
155
183
|
local deduplicationKeyExists
|
|
156
|
-
if ttl then
|
|
184
|
+
if ttl and ttl > 0 then
|
|
157
185
|
if deduplicationOpts['extend'] then
|
|
158
186
|
local currentDebounceJobId = rcall('GET', deduplicationKey)
|
|
159
187
|
if currentDebounceJobId then
|
|
@@ -175,6 +203,7 @@ local function deduplicateJob(deduplicationOpts, jobId, delayedKey, deduplicatio
|
|
|
175
203
|
end
|
|
176
204
|
if deduplicationKeyExists then
|
|
177
205
|
local currentDebounceJobId = rcall('GET', deduplicationKey)
|
|
206
|
+
-- TODO remove debounced event in next breaking change
|
|
178
207
|
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "debounced", "jobId",
|
|
179
208
|
currentDebounceJobId, "debounceId", deduplicationId)
|
|
180
209
|
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addDelayedJob-6.js","sourceRoot":"","sources":["../../../src/scripts/addDelayedJob-6.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG
|
|
1
|
+
{"version":3,"file":"addDelayedJob-6.js","sourceRoot":"","sources":["../../../src/scripts/addDelayedJob-6.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAudf,CAAC;AACW,QAAA,aAAa,GAAG;IAC3B,IAAI,EAAE,eAAe;IACrB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
|
|
@@ -56,37 +56,65 @@ local function removeJobKeys(jobKey)
|
|
|
56
56
|
return rcall("DEL", jobKey, jobKey .. ':logs', jobKey .. ':dependencies',
|
|
57
57
|
jobKey .. ':processed', jobKey .. ':failed', jobKey .. ':unsuccessful')
|
|
58
58
|
end
|
|
59
|
+
local function removeDelayedJob(delayedKey, deduplicationKey, eventsKey, maxEvents, currentDeduplicatedJobId,
|
|
60
|
+
jobId, deduplicationId, prefix)
|
|
61
|
+
if rcall("ZREM", delayedKey, currentDeduplicatedJobId) > 0 then
|
|
62
|
+
removeJobKeys(prefix .. currentDeduplicatedJobId)
|
|
63
|
+
rcall("XADD", eventsKey, "*", "event", "removed", "jobId", currentDeduplicatedJobId,
|
|
64
|
+
"prev", "delayed")
|
|
65
|
+
-- TODO remove debounced event in next breaking change
|
|
66
|
+
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "debounced", "jobId",
|
|
67
|
+
jobId, "debounceId", deduplicationId)
|
|
68
|
+
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
|
|
69
|
+
jobId, "deduplicationId", deduplicationId, "deduplicatedJobId", currentDeduplicatedJobId)
|
|
70
|
+
return true
|
|
71
|
+
end
|
|
72
|
+
return false
|
|
73
|
+
end
|
|
59
74
|
local function deduplicateJob(deduplicationOpts, jobId, delayedKey, deduplicationKey, eventsKey, maxEvents,
|
|
60
75
|
prefix)
|
|
61
76
|
local deduplicationId = deduplicationOpts and deduplicationOpts['id']
|
|
62
77
|
if deduplicationId then
|
|
63
78
|
local ttl = deduplicationOpts['ttl']
|
|
64
|
-
if deduplicationOpts['replace']
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
79
|
+
if deduplicationOpts['replace'] then
|
|
80
|
+
if ttl and ttl > 0 then
|
|
81
|
+
local currentDebounceJobId = rcall('GET', deduplicationKey)
|
|
82
|
+
if currentDebounceJobId then
|
|
83
|
+
local isRemoved = removeDelayedJob(delayedKey, deduplicationKey, eventsKey, maxEvents,
|
|
84
|
+
currentDebounceJobId, jobId, deduplicationId, prefix)
|
|
85
|
+
if isRemoved then
|
|
86
|
+
if deduplicationOpts['extend'] then
|
|
87
|
+
rcall('SET', deduplicationKey, jobId, 'PX', ttl)
|
|
88
|
+
else
|
|
89
|
+
rcall('SET', deduplicationKey, jobId, 'KEEPTTL')
|
|
90
|
+
end
|
|
91
|
+
return
|
|
73
92
|
else
|
|
74
|
-
|
|
93
|
+
return currentDebounceJobId
|
|
75
94
|
end
|
|
76
|
-
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
|
|
77
|
-
jobId, "deduplicationId", deduplicationId, "deduplicatedJobId", currentDebounceJobId)
|
|
78
|
-
return
|
|
79
95
|
else
|
|
80
|
-
|
|
96
|
+
rcall('SET', deduplicationKey, jobId, 'PX', ttl)
|
|
97
|
+
return
|
|
81
98
|
end
|
|
82
99
|
else
|
|
83
|
-
rcall('
|
|
84
|
-
|
|
100
|
+
local currentDebounceJobId = rcall('GET', deduplicationKey)
|
|
101
|
+
if currentDebounceJobId then
|
|
102
|
+
local isRemoved = removeDelayedJob(delayedKey, deduplicationKey, eventsKey, maxEvents,
|
|
103
|
+
currentDebounceJobId, jobId, deduplicationId, prefix)
|
|
104
|
+
if isRemoved then
|
|
105
|
+
rcall('SET', deduplicationKey, jobId)
|
|
106
|
+
return
|
|
107
|
+
else
|
|
108
|
+
return currentDebounceJobId
|
|
109
|
+
end
|
|
110
|
+
else
|
|
111
|
+
rcall('SET', deduplicationKey, jobId)
|
|
112
|
+
return
|
|
113
|
+
end
|
|
85
114
|
end
|
|
86
115
|
else
|
|
87
|
-
local ttl = deduplicationOpts['ttl']
|
|
88
116
|
local deduplicationKeyExists
|
|
89
|
-
if ttl then
|
|
117
|
+
if ttl and ttl > 0 then
|
|
90
118
|
if deduplicationOpts['extend'] then
|
|
91
119
|
local currentDebounceJobId = rcall('GET', deduplicationKey)
|
|
92
120
|
if currentDebounceJobId then
|
|
@@ -108,6 +136,7 @@ local function deduplicateJob(deduplicationOpts, jobId, delayedKey, deduplicatio
|
|
|
108
136
|
end
|
|
109
137
|
if deduplicationKeyExists then
|
|
110
138
|
local currentDebounceJobId = rcall('GET', deduplicationKey)
|
|
139
|
+
-- TODO remove debounced event in next breaking change
|
|
111
140
|
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "debounced", "jobId",
|
|
112
141
|
currentDebounceJobId, "debounceId", deduplicationId)
|
|
113
142
|
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addParentJob-5.js","sourceRoot":"","sources":["../../../src/scripts/addParentJob-5.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG
|
|
1
|
+
{"version":3,"file":"addParentJob-5.js","sourceRoot":"","sources":["../../../src/scripts/addParentJob-5.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+af,CAAC;AACW,QAAA,YAAY,GAAG;IAC1B,IAAI,EAAE,cAAc;IACpB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
|
|
@@ -88,37 +88,65 @@ local function removeJobKeys(jobKey)
|
|
|
88
88
|
return rcall("DEL", jobKey, jobKey .. ':logs', jobKey .. ':dependencies',
|
|
89
89
|
jobKey .. ':processed', jobKey .. ':failed', jobKey .. ':unsuccessful')
|
|
90
90
|
end
|
|
91
|
+
local function removeDelayedJob(delayedKey, deduplicationKey, eventsKey, maxEvents, currentDeduplicatedJobId,
|
|
92
|
+
jobId, deduplicationId, prefix)
|
|
93
|
+
if rcall("ZREM", delayedKey, currentDeduplicatedJobId) > 0 then
|
|
94
|
+
removeJobKeys(prefix .. currentDeduplicatedJobId)
|
|
95
|
+
rcall("XADD", eventsKey, "*", "event", "removed", "jobId", currentDeduplicatedJobId,
|
|
96
|
+
"prev", "delayed")
|
|
97
|
+
-- TODO remove debounced event in next breaking change
|
|
98
|
+
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "debounced", "jobId",
|
|
99
|
+
jobId, "debounceId", deduplicationId)
|
|
100
|
+
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
|
|
101
|
+
jobId, "deduplicationId", deduplicationId, "deduplicatedJobId", currentDeduplicatedJobId)
|
|
102
|
+
return true
|
|
103
|
+
end
|
|
104
|
+
return false
|
|
105
|
+
end
|
|
91
106
|
local function deduplicateJob(deduplicationOpts, jobId, delayedKey, deduplicationKey, eventsKey, maxEvents,
|
|
92
107
|
prefix)
|
|
93
108
|
local deduplicationId = deduplicationOpts and deduplicationOpts['id']
|
|
94
109
|
if deduplicationId then
|
|
95
110
|
local ttl = deduplicationOpts['ttl']
|
|
96
|
-
if deduplicationOpts['replace']
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
if
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
111
|
+
if deduplicationOpts['replace'] then
|
|
112
|
+
if ttl and ttl > 0 then
|
|
113
|
+
local currentDebounceJobId = rcall('GET', deduplicationKey)
|
|
114
|
+
if currentDebounceJobId then
|
|
115
|
+
local isRemoved = removeDelayedJob(delayedKey, deduplicationKey, eventsKey, maxEvents,
|
|
116
|
+
currentDebounceJobId, jobId, deduplicationId, prefix)
|
|
117
|
+
if isRemoved then
|
|
118
|
+
if deduplicationOpts['extend'] then
|
|
119
|
+
rcall('SET', deduplicationKey, jobId, 'PX', ttl)
|
|
120
|
+
else
|
|
121
|
+
rcall('SET', deduplicationKey, jobId, 'KEEPTTL')
|
|
122
|
+
end
|
|
123
|
+
return
|
|
105
124
|
else
|
|
106
|
-
|
|
125
|
+
return currentDebounceJobId
|
|
107
126
|
end
|
|
108
|
-
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
|
|
109
|
-
jobId, "deduplicationId", deduplicationId, "deduplicatedJobId", currentDebounceJobId)
|
|
110
|
-
return
|
|
111
127
|
else
|
|
112
|
-
|
|
128
|
+
rcall('SET', deduplicationKey, jobId, 'PX', ttl)
|
|
129
|
+
return
|
|
113
130
|
end
|
|
114
131
|
else
|
|
115
|
-
rcall('
|
|
116
|
-
|
|
132
|
+
local currentDebounceJobId = rcall('GET', deduplicationKey)
|
|
133
|
+
if currentDebounceJobId then
|
|
134
|
+
local isRemoved = removeDelayedJob(delayedKey, deduplicationKey, eventsKey, maxEvents,
|
|
135
|
+
currentDebounceJobId, jobId, deduplicationId, prefix)
|
|
136
|
+
if isRemoved then
|
|
137
|
+
rcall('SET', deduplicationKey, jobId)
|
|
138
|
+
return
|
|
139
|
+
else
|
|
140
|
+
return currentDebounceJobId
|
|
141
|
+
end
|
|
142
|
+
else
|
|
143
|
+
rcall('SET', deduplicationKey, jobId)
|
|
144
|
+
return
|
|
145
|
+
end
|
|
117
146
|
end
|
|
118
147
|
else
|
|
119
|
-
local ttl = deduplicationOpts['ttl']
|
|
120
148
|
local deduplicationKeyExists
|
|
121
|
-
if ttl then
|
|
149
|
+
if ttl and ttl > 0 then
|
|
122
150
|
if deduplicationOpts['extend'] then
|
|
123
151
|
local currentDebounceJobId = rcall('GET', deduplicationKey)
|
|
124
152
|
if currentDebounceJobId then
|
|
@@ -140,6 +168,7 @@ local function deduplicateJob(deduplicationOpts, jobId, delayedKey, deduplicatio
|
|
|
140
168
|
end
|
|
141
169
|
if deduplicationKeyExists then
|
|
142
170
|
local currentDebounceJobId = rcall('GET', deduplicationKey)
|
|
171
|
+
-- TODO remove debounced event in next breaking change
|
|
143
172
|
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "debounced", "jobId",
|
|
144
173
|
currentDebounceJobId, "debounceId", deduplicationId)
|
|
145
174
|
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addPrioritizedJob-9.js","sourceRoot":"","sources":["../../../src/scripts/addPrioritizedJob-9.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG
|
|
1
|
+
{"version":3,"file":"addPrioritizedJob-9.js","sourceRoot":"","sources":["../../../src/scripts/addPrioritizedJob-9.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAybf,CAAC;AACW,QAAA,iBAAiB,GAAG;IAC/B,IAAI,EAAE,mBAAmB;IACzB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
|
|
@@ -82,37 +82,65 @@ local function removeJobKeys(jobKey)
|
|
|
82
82
|
return rcall("DEL", jobKey, jobKey .. ':logs', jobKey .. ':dependencies',
|
|
83
83
|
jobKey .. ':processed', jobKey .. ':failed', jobKey .. ':unsuccessful')
|
|
84
84
|
end
|
|
85
|
+
local function removeDelayedJob(delayedKey, deduplicationKey, eventsKey, maxEvents, currentDeduplicatedJobId,
|
|
86
|
+
jobId, deduplicationId, prefix)
|
|
87
|
+
if rcall("ZREM", delayedKey, currentDeduplicatedJobId) > 0 then
|
|
88
|
+
removeJobKeys(prefix .. currentDeduplicatedJobId)
|
|
89
|
+
rcall("XADD", eventsKey, "*", "event", "removed", "jobId", currentDeduplicatedJobId,
|
|
90
|
+
"prev", "delayed")
|
|
91
|
+
-- TODO remove debounced event in next breaking change
|
|
92
|
+
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "debounced", "jobId",
|
|
93
|
+
jobId, "debounceId", deduplicationId)
|
|
94
|
+
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
|
|
95
|
+
jobId, "deduplicationId", deduplicationId, "deduplicatedJobId", currentDeduplicatedJobId)
|
|
96
|
+
return true
|
|
97
|
+
end
|
|
98
|
+
return false
|
|
99
|
+
end
|
|
85
100
|
local function deduplicateJob(deduplicationOpts, jobId, delayedKey, deduplicationKey, eventsKey, maxEvents,
|
|
86
101
|
prefix)
|
|
87
102
|
local deduplicationId = deduplicationOpts and deduplicationOpts['id']
|
|
88
103
|
if deduplicationId then
|
|
89
104
|
local ttl = deduplicationOpts['ttl']
|
|
90
|
-
if deduplicationOpts['replace']
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
if
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
105
|
+
if deduplicationOpts['replace'] then
|
|
106
|
+
if ttl and ttl > 0 then
|
|
107
|
+
local currentDebounceJobId = rcall('GET', deduplicationKey)
|
|
108
|
+
if currentDebounceJobId then
|
|
109
|
+
local isRemoved = removeDelayedJob(delayedKey, deduplicationKey, eventsKey, maxEvents,
|
|
110
|
+
currentDebounceJobId, jobId, deduplicationId, prefix)
|
|
111
|
+
if isRemoved then
|
|
112
|
+
if deduplicationOpts['extend'] then
|
|
113
|
+
rcall('SET', deduplicationKey, jobId, 'PX', ttl)
|
|
114
|
+
else
|
|
115
|
+
rcall('SET', deduplicationKey, jobId, 'KEEPTTL')
|
|
116
|
+
end
|
|
117
|
+
return
|
|
99
118
|
else
|
|
100
|
-
|
|
119
|
+
return currentDebounceJobId
|
|
101
120
|
end
|
|
102
|
-
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
|
|
103
|
-
jobId, "deduplicationId", deduplicationId, "deduplicatedJobId", currentDebounceJobId)
|
|
104
|
-
return
|
|
105
121
|
else
|
|
106
|
-
|
|
122
|
+
rcall('SET', deduplicationKey, jobId, 'PX', ttl)
|
|
123
|
+
return
|
|
107
124
|
end
|
|
108
125
|
else
|
|
109
|
-
rcall('
|
|
110
|
-
|
|
126
|
+
local currentDebounceJobId = rcall('GET', deduplicationKey)
|
|
127
|
+
if currentDebounceJobId then
|
|
128
|
+
local isRemoved = removeDelayedJob(delayedKey, deduplicationKey, eventsKey, maxEvents,
|
|
129
|
+
currentDebounceJobId, jobId, deduplicationId, prefix)
|
|
130
|
+
if isRemoved then
|
|
131
|
+
rcall('SET', deduplicationKey, jobId)
|
|
132
|
+
return
|
|
133
|
+
else
|
|
134
|
+
return currentDebounceJobId
|
|
135
|
+
end
|
|
136
|
+
else
|
|
137
|
+
rcall('SET', deduplicationKey, jobId)
|
|
138
|
+
return
|
|
139
|
+
end
|
|
111
140
|
end
|
|
112
141
|
else
|
|
113
|
-
local ttl = deduplicationOpts['ttl']
|
|
114
142
|
local deduplicationKeyExists
|
|
115
|
-
if ttl then
|
|
143
|
+
if ttl and ttl > 0 then
|
|
116
144
|
if deduplicationOpts['extend'] then
|
|
117
145
|
local currentDebounceJobId = rcall('GET', deduplicationKey)
|
|
118
146
|
if currentDebounceJobId then
|
|
@@ -134,6 +162,7 @@ local function deduplicateJob(deduplicationOpts, jobId, delayedKey, deduplicatio
|
|
|
134
162
|
end
|
|
135
163
|
if deduplicationKeyExists then
|
|
136
164
|
local currentDebounceJobId = rcall('GET', deduplicationKey)
|
|
165
|
+
-- TODO remove debounced event in next breaking change
|
|
137
166
|
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "debounced", "jobId",
|
|
138
167
|
currentDebounceJobId, "debounceId", deduplicationId)
|
|
139
168
|
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addStandardJob-9.js","sourceRoot":"","sources":["../../../src/scripts/addStandardJob-9.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG
|
|
1
|
+
{"version":3,"file":"addStandardJob-9.js","sourceRoot":"","sources":["../../../src/scripts/addStandardJob-9.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6bf,CAAC;AACW,QAAA,cAAc,GAAG;IAC5B,IAAI,EAAE,gBAAgB;IACtB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMetrics = void 0;
|
|
4
|
+
const content = `--[[
|
|
5
|
+
Get metrics
|
|
6
|
+
Input:
|
|
7
|
+
KEYS[1] 'metrics' key
|
|
8
|
+
KEYS[2] 'metrics data' key
|
|
9
|
+
ARGV[1] start index
|
|
10
|
+
ARGV[2] end index
|
|
11
|
+
]]
|
|
12
|
+
local rcall = redis.call;
|
|
13
|
+
local metricsKey = KEYS[1]
|
|
14
|
+
local dataKey = KEYS[2]
|
|
15
|
+
local metrics = rcall("HMGET", metricsKey, "count", "prevTS", "prevCount")
|
|
16
|
+
local data = rcall("LRANGE", dataKey, tonumber(ARGV[1]), tonumber(ARGV[2]))
|
|
17
|
+
local numPoints = rcall("LLEN", dataKey)
|
|
18
|
+
return {metrics, data, numPoints}
|
|
19
|
+
`;
|
|
20
|
+
exports.getMetrics = {
|
|
21
|
+
name: 'getMetrics',
|
|
22
|
+
content,
|
|
23
|
+
keys: 2,
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=getMetrics-2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getMetrics-2.js","sourceRoot":"","sources":["../../../src/scripts/getMetrics-2.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;CAef,CAAC;AACW,QAAA,UAAU,GAAG;IACxB,IAAI,EAAE,YAAY;IAClB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
|
|
@@ -18,6 +18,7 @@ tslib_1.__exportStar(require("./getCounts-1"), exports);
|
|
|
18
18
|
tslib_1.__exportStar(require("./getCountsPerPriority-4"), exports);
|
|
19
19
|
tslib_1.__exportStar(require("./getDependencyCounts-4"), exports);
|
|
20
20
|
tslib_1.__exportStar(require("./getJobScheduler-1"), exports);
|
|
21
|
+
tslib_1.__exportStar(require("./getMetrics-2"), exports);
|
|
21
22
|
tslib_1.__exportStar(require("./getRanges-1"), exports);
|
|
22
23
|
tslib_1.__exportStar(require("./getRateLimitTtl-1"), exports);
|
|
23
24
|
tslib_1.__exportStar(require("./getState-8"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/scripts/index.ts"],"names":[],"mappings":";;;AAAA,4DAAkC;AAClC,+DAAqC;AACrC,qDAA2B;AAC3B,2DAAiC;AACjC,gEAAsC;AACtC,+DAAqC;AACrC,6DAAmC;AACnC,0DAAgC;AAChC,6DAAmC;AACnC,6DAAmC;AACnC,oDAA0B;AAC1B,yDAA+B;AAC/B,0DAAgC;AAChC,wDAA8B;AAC9B,mEAAyC;AACzC,kEAAwC;AACxC,8DAAoC;AACpC,wDAA8B;AAC9B,8DAAoC;AACpC,uDAA6B;AAC7B,yDAA+B;AAC/B,yDAA+B;AAC/B,0DAAgC;AAChC,sDAA4B;AAC5B,sEAA4C;AAC5C,6DAAmC;AACnC,oEAA0C;AAC1C,4DAAkC;AAClC,4DAAkC;AAClC,8DAAoC;AACpC,oEAA0C;AAC1C,yDAA+B;AAC/B,uDAA6B;AAC7B,oDAA0B;AAC1B,sDAA4B;AAC5B,0DAAgC;AAChC,oEAA0C;AAC1C,wDAA8B;AAC9B,iEAAuC;AACvC,+DAAqC;AACrC,wEAA8C;AAC9C,2DAAiC;AACjC,wDAA8B;AAC9B,6DAAmC;AACnC,yDAA+B;AAC/B,kEAAwC;AACxC,6DAAmC;AACnC,wEAA8C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/scripts/index.ts"],"names":[],"mappings":";;;AAAA,4DAAkC;AAClC,+DAAqC;AACrC,qDAA2B;AAC3B,2DAAiC;AACjC,gEAAsC;AACtC,+DAAqC;AACrC,6DAAmC;AACnC,0DAAgC;AAChC,6DAAmC;AACnC,6DAAmC;AACnC,oDAA0B;AAC1B,yDAA+B;AAC/B,0DAAgC;AAChC,wDAA8B;AAC9B,mEAAyC;AACzC,kEAAwC;AACxC,8DAAoC;AACpC,yDAA+B;AAC/B,wDAA8B;AAC9B,8DAAoC;AACpC,uDAA6B;AAC7B,yDAA+B;AAC/B,yDAA+B;AAC/B,0DAAgC;AAChC,sDAA4B;AAC5B,sEAA4C;AAC5C,6DAAmC;AACnC,oEAA0C;AAC1C,4DAAkC;AAClC,4DAAkC;AAClC,8DAAoC;AACpC,oEAA0C;AAC1C,yDAA+B;AAC/B,uDAA6B;AAC7B,oDAA0B;AAC1B,sDAA4B;AAC5B,0DAAgC;AAChC,oEAA0C;AAC1C,wDAA8B;AAC9B,iEAAuC;AACvC,+DAAqC;AACrC,wEAA8C;AAC9C,2DAAiC;AACjC,wDAA8B;AAC9B,6DAAmC;AACnC,yDAA+B;AAC/B,kEAAwC;AACxC,6DAAmC;AACnC,wEAA8C"}
|
|
@@ -129,9 +129,9 @@ if rcall("EXISTS", jobKey) == 1 then
|
|
|
129
129
|
local delayedKey = KEYS[4]
|
|
130
130
|
local jobId = ARGV[3]
|
|
131
131
|
local delay = tonumber(ARGV[5])
|
|
132
|
-
local score, delayedTimestamp = getDelayedScore(delayedKey, ARGV[2], delay)
|
|
133
132
|
local numRemovedElements = rcall("LREM", KEYS[2], -1, jobId)
|
|
134
133
|
if numRemovedElements < 1 then return -3 end
|
|
134
|
+
local score, delayedTimestamp = getDelayedScore(delayedKey, ARGV[2], delay)
|
|
135
135
|
if ARGV[6] == "0" then
|
|
136
136
|
rcall("HINCRBY", jobKey, "atm", 1)
|
|
137
137
|
end
|