bullmq 5.44.4 → 5.45.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.
@@ -5,7 +5,12 @@ export interface QueueEventsListener extends IoredisListener {
5
5
  /**
6
6
  * Listen to 'active' event.
7
7
  *
8
- * This event is triggered when a job enters the 'active' state.
8
+ * This event is triggered when a job enters the 'active' state, meaning it is being processed.
9
+ *
10
+ * @param args - An object containing details about the job that became active.
11
+ * @param args.jobId - The unique identifier of the job that entered the active state.
12
+ * @param args.prev - The previous state of the job before it became active (e.g., 'waiting'), if applicable.
13
+ * @param id - The identifier of the event.
9
14
  */
10
15
  active: (args: {
11
16
  jobId: string;
@@ -14,7 +19,12 @@ export interface QueueEventsListener extends IoredisListener {
14
19
  /**
15
20
  * Listen to 'added' event.
16
21
  *
17
- * This event is triggered when a job is created.
22
+ * This event is triggered when a job is created and added to the queue.
23
+ *
24
+ * @param args - An object containing details about the newly added job.
25
+ * @param args.jobId - The unique identifier of the job that was added.
26
+ * @param args.name - The name of the job, typically indicating its type or purpose.
27
+ * @param id - The identifier of the event.
18
28
  */
19
29
  added: (args: {
20
30
  jobId: string;
@@ -23,7 +33,11 @@ export interface QueueEventsListener extends IoredisListener {
23
33
  /**
24
34
  * Listen to 'cleaned' event.
25
35
  *
26
- * This event is triggered when a cleaned method is triggered.
36
+ * This event is triggered when jobs are cleaned (e.g., removed) from the queue, typically via a cleanup method.
37
+ *
38
+ * @param args - An object containing the count of cleaned jobs.
39
+ * @param args.count - The number of jobs that were cleaned, represented as a string due to Redis serialization.
40
+ * @param id - The identifier of the event.
27
41
  */
28
42
  cleaned: (args: {
29
43
  count: string;
@@ -31,7 +45,13 @@ export interface QueueEventsListener extends IoredisListener {
31
45
  /**
32
46
  * Listen to 'completed' event.
33
47
  *
34
- * This event is triggered when a job has successfully completed.
48
+ * This event is triggered when a job has successfully completed its execution.
49
+ *
50
+ * @param args - An object containing details about the completed job.
51
+ * @param args.jobId - The unique identifier of the job that completed.
52
+ * @param args.returnvalue - The return value of the job, serialized as a string.
53
+ * @param args.prev - The previous state of the job before completion (e.g., 'active'), if applicable.
54
+ * @param id - The identifier of the event.
35
55
  */
36
56
  completed: (args: {
37
57
  jobId: string;
@@ -40,9 +60,15 @@ export interface QueueEventsListener extends IoredisListener {
40
60
  }, id: string) => void;
41
61
  /**
42
62
  * Listen to 'debounced' event.
43
- * @deprecated use deduplicated event
44
63
  *
45
- * This event is triggered when a job is debounced because debounceId still existed.
64
+ * @deprecated Use the 'deduplicated' event instead.
65
+ *
66
+ * This event is triggered when a job is debounced because a job with the same debounceId still exists.
67
+ *
68
+ * @param args - An object containing details about the debounced job.
69
+ * @param args.jobId - The unique identifier of the job that was debounced.
70
+ * @param args.debounceId - The identifier used to debounce the job, preventing duplicate processing.
71
+ * @param id - The identifier of the event.
46
72
  */
47
73
  debounced: (args: {
48
74
  jobId: string;
@@ -51,16 +77,29 @@ export interface QueueEventsListener extends IoredisListener {
51
77
  /**
52
78
  * Listen to 'deduplicated' event.
53
79
  *
54
- * This event is triggered when a job is deduplicated because deduplicatedId still existed.
80
+ * This event is triggered when a job is not added to the queue because a job with the same deduplicationId
81
+ * already exists.
82
+ *
83
+ * @param args - An object containing details about the deduplicated job.
84
+ * @param args.jobId - The unique identifier of the job that was attempted to be added.
85
+ * @param args.deduplicationId - The deduplication identifier that caused the job to be deduplicated.
86
+ * @param args.deduplicatedJobId - The unique identifier of the existing job that caused the deduplication.
87
+ * @param id - The identifier of the event.
55
88
  */
56
89
  deduplicated: (args: {
57
90
  jobId: string;
58
91
  deduplicationId: string;
92
+ deduplicatedJobId: string;
59
93
  }, id: string) => void;
60
94
  /**
61
95
  * Listen to 'delayed' event.
62
96
  *
63
- * This event is triggered when a job is delayed.
97
+ * This event is triggered when a job is scheduled with a delay before it becomes active.
98
+ *
99
+ * @param args - An object containing details about the delayed job.
100
+ * @param args.jobId - The unique identifier of the job that was delayed.
101
+ * @param args.delay - The delay duration in milliseconds before the job becomes active.
102
+ * @param id - The identifier of the event.
64
103
  */
65
104
  delayed: (args: {
66
105
  jobId: string;
@@ -69,15 +108,22 @@ export interface QueueEventsListener extends IoredisListener {
69
108
  /**
70
109
  * Listen to 'drained' event.
71
110
  *
72
- * This event is triggered when the queue has drained the waiting list.
111
+ * This event is triggered when the queue has drained its waiting list, meaning there are no jobs
112
+ * in the 'waiting' state.
73
113
  * Note that there could still be delayed jobs waiting their timers to expire
74
114
  * and this event will still be triggered as long as the waiting list has emptied.
115
+ *
116
+ * @param id - The identifier of the event.
75
117
  */
76
118
  drained: (id: string) => void;
77
119
  /**
78
120
  * Listen to 'duplicated' event.
79
121
  *
80
- * This event is triggered when a job is not created because it already exist.
122
+ * This event is triggered when a job is not created because a job with the same identifier already exists.
123
+ *
124
+ * @param args - An object containing the job identifier.
125
+ * @param args.jobId - The unique identifier of the job that was attempted to be added.
126
+ * @param id - The identifier of the event.
81
127
  */
82
128
  duplicated: (args: {
83
129
  jobId: string;
@@ -85,13 +131,19 @@ export interface QueueEventsListener extends IoredisListener {
85
131
  /**
86
132
  * Listen to 'error' event.
87
133
  *
88
- * This event is triggered when an exception is thrown.
134
+ * This event is triggered when an error in the Redis backend is thrown.
89
135
  */
90
136
  error: (args: Error) => void;
91
137
  /**
92
138
  * Listen to 'failed' event.
93
139
  *
94
- * This event is triggered when a job has thrown an exception.
140
+ * This event is triggered when a job fails by throwing an exception during execution.
141
+ *
142
+ * @param args - An object containing details about the failed job.
143
+ * @param args.jobId - The unique identifier of the job that failed.
144
+ * @param args.failedReason - The reason or message describing why the job failed.
145
+ * @param args.prev - The previous state of the job before failure (e.g., 'active'), if applicable.
146
+ * @param id - The identifier of the event.
95
147
  */
96
148
  failed: (args: {
97
149
  jobId: string;
@@ -101,16 +153,22 @@ export interface QueueEventsListener extends IoredisListener {
101
153
  /**
102
154
  * Listen to 'paused' event.
103
155
  *
104
- * This event is triggered when a queue is paused.
156
+ * This event is triggered when the queue is paused, halting the processing of new jobs.
157
+ *
158
+ * @param args - An empty object (no additional data provided).
159
+ * @param id - The identifier of the event.
105
160
  */
106
161
  paused: (args: {}, id: string) => void;
107
162
  /**
108
163
  * Listen to 'progress' event.
109
164
  *
110
- * This event is triggered when a job updates it progress, i.e. the
111
- * Job##updateProgress() method is called. This is useful to notify
112
- * progress or any other data from within a processor to the rest of the
113
- * world.
165
+ * This event is triggered when a job updates its progress via the `Job#updateProgress()` method, allowing
166
+ * progress or custom data to be communicated externally.
167
+ *
168
+ * @param args - An object containing the job identifier and progress data.
169
+ * @param args.jobId - The unique identifier of the job reporting progress.
170
+ * @param args.data - The progress data, which can be a number (e.g., percentage) or an object with custom data.
171
+ * @param id - The identifier of the event.
114
172
  */
115
173
  progress: (args: {
116
174
  jobId: string;
@@ -119,8 +177,12 @@ export interface QueueEventsListener extends IoredisListener {
119
177
  /**
120
178
  * Listen to 'removed' event.
121
179
  *
122
- * This event is triggered when a job has been manually
123
- * removed from the queue.
180
+ * This event is triggered when a job is manually removed from the queue.
181
+ *
182
+ * @param args - An object containing details about the removed job.
183
+ * @param args.jobId - The unique identifier of the job that was removed.
184
+ * @param args.prev - The previous state of the job before removal (e.g., 'active' or 'waiting').
185
+ * @param id - The identifier of the event.
124
186
  */
125
187
  removed: (args: {
126
188
  jobId: string;
@@ -129,13 +191,22 @@ export interface QueueEventsListener extends IoredisListener {
129
191
  /**
130
192
  * Listen to 'resumed' event.
131
193
  *
132
- * This event is triggered when a queue is resumed.
194
+ * This event is triggered when the queue is resumed, allowing job processing to continue.
195
+ *
196
+ * @param args - An empty object (no additional data provided).
197
+ * @param id - The identifier of the event.
133
198
  */
134
199
  resumed: (args: {}, id: string) => void;
135
200
  /**
136
201
  * Listen to 'retries-exhausted' event.
137
202
  *
138
- * This event is triggered when a job has retried the maximum attempts.
203
+ * This event is triggered when a job has exhausted its maximum retry attempts after repeated failures.
204
+ *
205
+ * @param args - An object containing details about the job that exhausted retries.
206
+ * @param args.jobId - The unique identifier of the job that exhausted its retries.
207
+ * @param args.attemptsMade - The number of retry attempts made, represented as a string
208
+ * (due to Redis serialization).
209
+ * @param id - The identifier of the event.
139
210
  */
140
211
  'retries-exhausted': (args: {
141
212
  jobId: string;
@@ -144,9 +215,13 @@ export interface QueueEventsListener extends IoredisListener {
144
215
  /**
145
216
  * Listen to 'stalled' event.
146
217
  *
147
- * This event is triggered when a job has been moved from 'active' back
148
- * to 'waiting'/'failed' due to the processor not being able to renew
149
- * the lock on the said job.
218
+ * This event is triggered when a job moves from 'active' back to 'waiting' or
219
+ * 'failed' because the processor could not renew its lock, indicating a
220
+ * potential processing issue.
221
+ *
222
+ * @param args - An object containing the job identifier.
223
+ * @param args.jobId - The unique identifier of the job that stalled.
224
+ * @param id - The identifier of the event.
150
225
  */
151
226
  stalled: (args: {
152
227
  jobId: string;
@@ -154,7 +229,14 @@ export interface QueueEventsListener extends IoredisListener {
154
229
  /**
155
230
  * Listen to 'waiting' event.
156
231
  *
157
- * This event is triggered when a job enters the 'waiting' state.
232
+ * This event is triggered when a job enters the 'waiting' state, indicating it is queued and
233
+ * awaiting processing.
234
+ *
235
+ * @param args - An object containing details about the job in the waiting state.
236
+ * @param args.jobId - The unique identifier of the job that is waiting.
237
+ * @param args.prev - The previous state of the job before entering 'waiting' (e.g., 'stalled'),
238
+ * if applicable.
239
+ * @param id - The identifier of the event.
158
240
  */
159
241
  waiting: (args: {
160
242
  jobId: string;
@@ -163,7 +245,12 @@ export interface QueueEventsListener extends IoredisListener {
163
245
  /**
164
246
  * Listen to 'waiting-children' event.
165
247
  *
166
- * This event is triggered when a job enters the 'waiting-children' state.
248
+ * This event is triggered when a job enters the 'waiting-children' state, indicating it is
249
+ * waiting for its child jobs to complete.
250
+ *
251
+ * @param args - An object containing the job identifier.
252
+ * @param args.jobId - The unique identifier of the job waiting for its children.
253
+ * @param id - The identifier of the event.
167
254
  */
168
255
  'waiting-children': (args: {
169
256
  jobId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"queue-events.js","sourceRoot":"","sources":["../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AC,CAAC;yBAC9D;qBACF;iBACF;aACF;SACF;IACH,CAAC;IAED;;;;OAIG;IACH,KAAK;QACH,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACjB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;SAClC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF"}
1
+ {"version":3,"file":"queue-events.js","sourceRoot":"","sources":["../../../src/classes/queue-events.ts"],"names":[],"mappings":";AAMA,OAAO,EACL,SAAS,EACT,uBAAuB,EACvB,eAAe,EACf,kBAAkB,GACnB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAgQzC;;;;;;GAMG;AACH,MAAM,OAAO,WAAY,SAAQ,SAAS;IAGxC,YACE,IAAY,EACZ,KAA8D;QAC5D,UAAU,EAAE,EAAE;KACf,EACD,UAAmC;YAHnC,EAAE,UAAU,EAAE,OAAO,GAAG,IAAI,OAE3B,EAFgC,IAAI,cAArC,yBAAuC,CAAF;QAKrC,KAAK,CACH,IAAI,kCAEC,IAAI,KACP,UAAU,EAAE,eAAe,CAAC,UAAU,CAAC;gBACrC,CAAC,CAAe,UAAW,CAAC,SAAS,EAAE;gBACvC,CAAC,CAAC,UAAU,KAEhB,UAAU,EACV,IAAI,CACL,CAAC;QAnBI,YAAO,GAAG,KAAK,CAAC;QAqBtB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,CACvB;YACE,eAAe,EAAE,KAAK;SACvB,EACD,IAAI,CAAC,IAAI,CACV,CAAC;QAEF,IAAI,OAAO,EAAE;YACX,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;SACtD;IACH,CAAC;IAED,IAAI,CAGF,KAAQ,EAAE,GAAG,IAA8B;QAC3C,OAAO,KAAK,CAAC,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I,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;qBACtB;yBAAM;wBACL,IAAI,CAAC,IAAI,CAAC,KAAY,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;wBACtC,IAAI,QAAQ,CAAC,KAAK,EAAE;4BAClB,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK,IAAI,QAAQ,CAAC,KAAK,EAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;yBAC9D;qBACF;iBACF;aACF;SACF;IACH,CAAC;IAED;;;;OAIG;IACH,KAAK;QACH,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACjB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;SAClC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF"}
@@ -1,24 +1,23 @@
1
1
  --[[
2
2
  Function to debounce a job.
3
- ]]
4
-
3
+ ]]
5
4
  local function deduplicateJob(deduplicationOpts, jobId, deduplicationKey, eventsKey, maxEvents)
6
5
  local deduplicationId = deduplicationOpts and deduplicationOpts['id']
7
6
  if deduplicationId then
8
- local ttl = deduplicationOpts['ttl']
9
- local deduplicationKeyExists
10
- if ttl then
11
- deduplicationKeyExists = not rcall('SET', deduplicationKey, jobId, 'PX', ttl, 'NX')
12
- else
13
- deduplicationKeyExists = not rcall('SET', deduplicationKey, jobId, 'NX')
14
- end
15
- if deduplicationKeyExists then
16
- local currentDebounceJobId = rcall('GET', deduplicationKey)
17
- rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event",
18
- "debounced", "jobId", currentDebounceJobId, "debounceId", deduplicationId)
19
- rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event",
20
- "deduplicated", "jobId", currentDebounceJobId, "deduplicationId", deduplicationId)
21
- return currentDebounceJobId
22
- end
7
+ local ttl = deduplicationOpts['ttl']
8
+ local deduplicationKeyExists
9
+ if ttl then
10
+ deduplicationKeyExists = not rcall('SET', deduplicationKey, jobId, 'PX', ttl, 'NX')
11
+ else
12
+ deduplicationKeyExists = not rcall('SET', deduplicationKey, jobId, 'NX')
13
+ end
14
+ if deduplicationKeyExists then
15
+ local currentDebounceJobId = rcall('GET', deduplicationKey)
16
+ rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "debounced", "jobId", currentDebounceJobId,
17
+ "debounceId", deduplicationId)
18
+ rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
19
+ currentDebounceJobId, "deduplicationId", deduplicationId, "deduplicatedJobId", jobId)
20
+ return currentDebounceJobId
21
+ end
23
22
  end
24
23
  end
@@ -111,25 +111,25 @@ local function addDelayedJob(jobId, delayedKey, eventsKey, timestamp,
111
111
  end
112
112
  --[[
113
113
  Function to debounce a job.
114
- ]]
114
+ ]]
115
115
  local function deduplicateJob(deduplicationOpts, jobId, deduplicationKey, eventsKey, maxEvents)
116
116
  local deduplicationId = deduplicationOpts and deduplicationOpts['id']
117
117
  if deduplicationId then
118
- local ttl = deduplicationOpts['ttl']
119
- local deduplicationKeyExists
120
- if ttl then
121
- deduplicationKeyExists = not rcall('SET', deduplicationKey, jobId, 'PX', ttl, 'NX')
122
- else
123
- deduplicationKeyExists = not rcall('SET', deduplicationKey, jobId, 'NX')
124
- end
125
- if deduplicationKeyExists then
126
- local currentDebounceJobId = rcall('GET', deduplicationKey)
127
- rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event",
128
- "debounced", "jobId", currentDebounceJobId, "debounceId", deduplicationId)
129
- rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event",
130
- "deduplicated", "jobId", currentDebounceJobId, "deduplicationId", deduplicationId)
131
- return currentDebounceJobId
132
- end
118
+ local ttl = deduplicationOpts['ttl']
119
+ local deduplicationKeyExists
120
+ if ttl then
121
+ deduplicationKeyExists = not rcall('SET', deduplicationKey, jobId, 'PX', ttl, 'NX')
122
+ else
123
+ deduplicationKeyExists = not rcall('SET', deduplicationKey, jobId, 'NX')
124
+ end
125
+ if deduplicationKeyExists then
126
+ local currentDebounceJobId = rcall('GET', deduplicationKey)
127
+ rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "debounced", "jobId", currentDebounceJobId,
128
+ "debounceId", deduplicationId)
129
+ rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
130
+ currentDebounceJobId, "deduplicationId", deduplicationId, "deduplicatedJobId", jobId)
131
+ return currentDebounceJobId
132
+ end
133
133
  end
134
134
  end
135
135
  --[[
@@ -43,25 +43,25 @@ local parentData
43
43
  -- Includes
44
44
  --[[
45
45
  Function to debounce a job.
46
- ]]
46
+ ]]
47
47
  local function deduplicateJob(deduplicationOpts, jobId, deduplicationKey, eventsKey, maxEvents)
48
48
  local deduplicationId = deduplicationOpts and deduplicationOpts['id']
49
49
  if deduplicationId then
50
- local ttl = deduplicationOpts['ttl']
51
- local deduplicationKeyExists
52
- if ttl then
53
- deduplicationKeyExists = not rcall('SET', deduplicationKey, jobId, 'PX', ttl, 'NX')
54
- else
55
- deduplicationKeyExists = not rcall('SET', deduplicationKey, jobId, 'NX')
56
- end
57
- if deduplicationKeyExists then
58
- local currentDebounceJobId = rcall('GET', deduplicationKey)
59
- rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event",
60
- "debounced", "jobId", currentDebounceJobId, "debounceId", deduplicationId)
61
- rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event",
62
- "deduplicated", "jobId", currentDebounceJobId, "deduplicationId", deduplicationId)
63
- return currentDebounceJobId
64
- end
50
+ local ttl = deduplicationOpts['ttl']
51
+ local deduplicationKeyExists
52
+ if ttl then
53
+ deduplicationKeyExists = not rcall('SET', deduplicationKey, jobId, 'PX', ttl, 'NX')
54
+ else
55
+ deduplicationKeyExists = not rcall('SET', deduplicationKey, jobId, 'NX')
56
+ end
57
+ if deduplicationKeyExists then
58
+ local currentDebounceJobId = rcall('GET', deduplicationKey)
59
+ rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "debounced", "jobId", currentDebounceJobId,
60
+ "debounceId", deduplicationId)
61
+ rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
62
+ currentDebounceJobId, "deduplicationId", deduplicationId, "deduplicatedJobId", jobId)
63
+ return currentDebounceJobId
64
+ end
65
65
  end
66
66
  end
67
67
  --[[
@@ -75,25 +75,25 @@ local function addJobWithPriority(markerKey, prioritizedKey, priority, jobId, pr
75
75
  end
76
76
  --[[
77
77
  Function to debounce a job.
78
- ]]
78
+ ]]
79
79
  local function deduplicateJob(deduplicationOpts, jobId, deduplicationKey, eventsKey, maxEvents)
80
80
  local deduplicationId = deduplicationOpts and deduplicationOpts['id']
81
81
  if deduplicationId then
82
- local ttl = deduplicationOpts['ttl']
83
- local deduplicationKeyExists
84
- if ttl then
85
- deduplicationKeyExists = not rcall('SET', deduplicationKey, jobId, 'PX', ttl, 'NX')
86
- else
87
- deduplicationKeyExists = not rcall('SET', deduplicationKey, jobId, 'NX')
88
- end
89
- if deduplicationKeyExists then
90
- local currentDebounceJobId = rcall('GET', deduplicationKey)
91
- rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event",
92
- "debounced", "jobId", currentDebounceJobId, "debounceId", deduplicationId)
93
- rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event",
94
- "deduplicated", "jobId", currentDebounceJobId, "deduplicationId", deduplicationId)
95
- return currentDebounceJobId
96
- end
82
+ local ttl = deduplicationOpts['ttl']
83
+ local deduplicationKeyExists
84
+ if ttl then
85
+ deduplicationKeyExists = not rcall('SET', deduplicationKey, jobId, 'PX', ttl, 'NX')
86
+ else
87
+ deduplicationKeyExists = not rcall('SET', deduplicationKey, jobId, 'NX')
88
+ end
89
+ if deduplicationKeyExists then
90
+ local currentDebounceJobId = rcall('GET', deduplicationKey)
91
+ rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "debounced", "jobId", currentDebounceJobId,
92
+ "debounceId", deduplicationId)
93
+ rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
94
+ currentDebounceJobId, "deduplicationId", deduplicationId, "deduplicatedJobId", jobId)
95
+ return currentDebounceJobId
96
+ end
97
97
  end
98
98
  end
99
99
  --[[
@@ -69,25 +69,25 @@ local function addJobInTargetList(targetKey, markerKey, pushCmd, isPausedOrMaxed
69
69
  end
70
70
  --[[
71
71
  Function to debounce a job.
72
- ]]
72
+ ]]
73
73
  local function deduplicateJob(deduplicationOpts, jobId, deduplicationKey, eventsKey, maxEvents)
74
74
  local deduplicationId = deduplicationOpts and deduplicationOpts['id']
75
75
  if deduplicationId then
76
- local ttl = deduplicationOpts['ttl']
77
- local deduplicationKeyExists
78
- if ttl then
79
- deduplicationKeyExists = not rcall('SET', deduplicationKey, jobId, 'PX', ttl, 'NX')
80
- else
81
- deduplicationKeyExists = not rcall('SET', deduplicationKey, jobId, 'NX')
82
- end
83
- if deduplicationKeyExists then
84
- local currentDebounceJobId = rcall('GET', deduplicationKey)
85
- rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event",
86
- "debounced", "jobId", currentDebounceJobId, "debounceId", deduplicationId)
87
- rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event",
88
- "deduplicated", "jobId", currentDebounceJobId, "deduplicationId", deduplicationId)
89
- return currentDebounceJobId
90
- end
76
+ local ttl = deduplicationOpts['ttl']
77
+ local deduplicationKeyExists
78
+ if ttl then
79
+ deduplicationKeyExists = not rcall('SET', deduplicationKey, jobId, 'PX', ttl, 'NX')
80
+ else
81
+ deduplicationKeyExists = not rcall('SET', deduplicationKey, jobId, 'NX')
82
+ end
83
+ if deduplicationKeyExists then
84
+ local currentDebounceJobId = rcall('GET', deduplicationKey)
85
+ rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "debounced", "jobId", currentDebounceJobId,
86
+ "debounceId", deduplicationId)
87
+ rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
88
+ currentDebounceJobId, "deduplicationId", deduplicationId, "deduplicatedJobId", jobId)
89
+ return currentDebounceJobId
90
+ end
91
91
  end
92
92
  end
93
93
  --[[