bullmq 5.66.3 → 5.66.4
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/commands/addParentJob-6.lua +0 -7
- package/dist/cjs/scripts/addParentJob-6.js +0 -106
- package/dist/cjs/scripts/addParentJob-6.js.map +1 -1
- package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/commands/addParentJob-6.lua +0 -7
- package/dist/esm/interfaces/flow-job.d.ts +2 -2
- package/dist/esm/scripts/addParentJob-6.js +0 -106
- package/dist/esm/scripts/addParentJob-6.js.map +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 +1 -1
|
@@ -42,107 +42,6 @@ local repeatJobKey = args[8]
|
|
|
42
42
|
local deduplicationKey = args[9]
|
|
43
43
|
local parentData
|
|
44
44
|
-- Includes
|
|
45
|
-
--[[
|
|
46
|
-
Function to debounce a job.
|
|
47
|
-
]]
|
|
48
|
-
-- Includes
|
|
49
|
-
--[[
|
|
50
|
-
Function to remove job keys.
|
|
51
|
-
]]
|
|
52
|
-
local function removeJobKeys(jobKey)
|
|
53
|
-
return rcall("DEL", jobKey, jobKey .. ':logs', jobKey .. ':dependencies',
|
|
54
|
-
jobKey .. ':processed', jobKey .. ':failed', jobKey .. ':unsuccessful')
|
|
55
|
-
end
|
|
56
|
-
local function removeDelayedJob(delayedKey, deduplicationKey, eventsKey, maxEvents, currentDeduplicatedJobId,
|
|
57
|
-
jobId, deduplicationId, prefix)
|
|
58
|
-
if rcall("ZREM", delayedKey, currentDeduplicatedJobId) > 0 then
|
|
59
|
-
removeJobKeys(prefix .. currentDeduplicatedJobId)
|
|
60
|
-
rcall("XADD", eventsKey, "*", "event", "removed", "jobId", currentDeduplicatedJobId,
|
|
61
|
-
"prev", "delayed")
|
|
62
|
-
-- TODO remove debounced event in next breaking change
|
|
63
|
-
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "debounced", "jobId",
|
|
64
|
-
jobId, "debounceId", deduplicationId)
|
|
65
|
-
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
|
|
66
|
-
jobId, "deduplicationId", deduplicationId, "deduplicatedJobId", currentDeduplicatedJobId)
|
|
67
|
-
return true
|
|
68
|
-
end
|
|
69
|
-
return false
|
|
70
|
-
end
|
|
71
|
-
local function deduplicateJob(deduplicationOpts, jobId, delayedKey, deduplicationKey, eventsKey, maxEvents,
|
|
72
|
-
prefix)
|
|
73
|
-
local deduplicationId = deduplicationOpts and deduplicationOpts['id']
|
|
74
|
-
if deduplicationId then
|
|
75
|
-
local ttl = deduplicationOpts['ttl']
|
|
76
|
-
if deduplicationOpts['replace'] then
|
|
77
|
-
if ttl and ttl > 0 then
|
|
78
|
-
local currentDebounceJobId = rcall('GET', deduplicationKey)
|
|
79
|
-
if currentDebounceJobId then
|
|
80
|
-
local isRemoved = removeDelayedJob(delayedKey, deduplicationKey, eventsKey, maxEvents,
|
|
81
|
-
currentDebounceJobId, jobId, deduplicationId, prefix)
|
|
82
|
-
if isRemoved then
|
|
83
|
-
if deduplicationOpts['extend'] then
|
|
84
|
-
rcall('SET', deduplicationKey, jobId, 'PX', ttl)
|
|
85
|
-
else
|
|
86
|
-
rcall('SET', deduplicationKey, jobId, 'KEEPTTL')
|
|
87
|
-
end
|
|
88
|
-
return
|
|
89
|
-
else
|
|
90
|
-
return currentDebounceJobId
|
|
91
|
-
end
|
|
92
|
-
else
|
|
93
|
-
rcall('SET', deduplicationKey, jobId, 'PX', ttl)
|
|
94
|
-
return
|
|
95
|
-
end
|
|
96
|
-
else
|
|
97
|
-
local currentDebounceJobId = rcall('GET', deduplicationKey)
|
|
98
|
-
if currentDebounceJobId then
|
|
99
|
-
local isRemoved = removeDelayedJob(delayedKey, deduplicationKey, eventsKey, maxEvents,
|
|
100
|
-
currentDebounceJobId, jobId, deduplicationId, prefix)
|
|
101
|
-
if isRemoved then
|
|
102
|
-
rcall('SET', deduplicationKey, jobId)
|
|
103
|
-
return
|
|
104
|
-
else
|
|
105
|
-
return currentDebounceJobId
|
|
106
|
-
end
|
|
107
|
-
else
|
|
108
|
-
rcall('SET', deduplicationKey, jobId)
|
|
109
|
-
return
|
|
110
|
-
end
|
|
111
|
-
end
|
|
112
|
-
else
|
|
113
|
-
local deduplicationKeyExists
|
|
114
|
-
if ttl and ttl > 0 then
|
|
115
|
-
if deduplicationOpts['extend'] then
|
|
116
|
-
local currentDebounceJobId = rcall('GET', deduplicationKey)
|
|
117
|
-
if currentDebounceJobId then
|
|
118
|
-
rcall('SET', deduplicationKey, currentDebounceJobId, 'PX', ttl)
|
|
119
|
-
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "debounced",
|
|
120
|
-
"jobId", currentDebounceJobId, "debounceId", deduplicationId)
|
|
121
|
-
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
|
|
122
|
-
currentDebounceJobId, "deduplicationId", deduplicationId, "deduplicatedJobId", jobId)
|
|
123
|
-
return currentDebounceJobId
|
|
124
|
-
else
|
|
125
|
-
rcall('SET', deduplicationKey, jobId, 'PX', ttl)
|
|
126
|
-
return
|
|
127
|
-
end
|
|
128
|
-
else
|
|
129
|
-
deduplicationKeyExists = not rcall('SET', deduplicationKey, jobId, 'PX', ttl, 'NX')
|
|
130
|
-
end
|
|
131
|
-
else
|
|
132
|
-
deduplicationKeyExists = not rcall('SET', deduplicationKey, jobId, 'NX')
|
|
133
|
-
end
|
|
134
|
-
if deduplicationKeyExists then
|
|
135
|
-
local currentDebounceJobId = rcall('GET', deduplicationKey)
|
|
136
|
-
-- TODO remove debounced event in next breaking change
|
|
137
|
-
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "debounced", "jobId",
|
|
138
|
-
currentDebounceJobId, "debounceId", deduplicationId)
|
|
139
|
-
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
|
|
140
|
-
currentDebounceJobId, "deduplicationId", deduplicationId, "deduplicatedJobId", jobId)
|
|
141
|
-
return currentDebounceJobId
|
|
142
|
-
end
|
|
143
|
-
end
|
|
144
|
-
end
|
|
145
|
-
end
|
|
146
45
|
--[[
|
|
147
46
|
Function to get max events value or set by default 10000.
|
|
148
47
|
]]
|
|
@@ -412,11 +311,6 @@ else
|
|
|
412
311
|
maxEvents, timestamp)
|
|
413
312
|
end
|
|
414
313
|
end
|
|
415
|
-
local deduplicationJobId = deduplicateJob(opts['de'], jobId, KEYS[3],
|
|
416
|
-
deduplicationKey, eventsKey, maxEvents, args[1])
|
|
417
|
-
if deduplicationJobId then
|
|
418
|
-
return deduplicationJobId
|
|
419
|
-
end
|
|
420
314
|
-- Store the job.
|
|
421
315
|
storeJob(eventsKey, jobIdKey, jobId, args[3], ARGV[2], opts, timestamp,
|
|
422
316
|
parentKey, parentData, repeatJobKey)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addParentJob-6.js","sourceRoot":"","sources":["../../../src/scripts/addParentJob-6.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG
|
|
1
|
+
{"version":3,"file":"addParentJob-6.js","sourceRoot":"","sources":["../../../src/scripts/addParentJob-6.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqUf,CAAC;AACF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,cAAc;IACpB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
|