bullmq 5.66.3 → 5.66.5

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.
@@ -52,7 +52,6 @@ local deduplicationKey = args[9]
52
52
  local parentData
53
53
 
54
54
  -- Includes
55
- --- @include "includes/deduplicateJob"
56
55
  --- @include "includes/getOrSetMaxEvents"
57
56
  --- @include "includes/handleDuplicatedJob"
58
57
  --- @include "includes/storeJob"
@@ -82,12 +81,6 @@ else
82
81
  end
83
82
  end
84
83
 
85
- local deduplicationJobId = deduplicateJob(opts['de'], jobId, KEYS[3],
86
- deduplicationKey, eventsKey, maxEvents, args[1])
87
- if deduplicationJobId then
88
- return deduplicationJobId
89
- end
90
-
91
84
  -- Store the job.
92
85
  storeJob(eventsKey, jobIdKey, jobId, args[3], ARGV[2], opts, timestamp,
93
86
  parentKey, parentData, repeatJobKey)
@@ -102,11 +102,12 @@ end
102
102
  if(maxCount > 0) then
103
103
  rcall("DEL",
104
104
  baseKey .. 'events',
105
- baseKey .. 'delay',
105
+ baseKey .. 'delay',
106
106
  baseKey .. 'stalled-check',
107
107
  baseKey .. 'stalled',
108
108
  baseKey .. 'id',
109
109
  baseKey .. 'pc',
110
+ baseKey .. 'marker',
110
111
  baseKey .. 'meta',
111
112
  baseKey .. 'metrics:completed',
112
113
  baseKey .. 'metrics:completed:data',
@@ -45,107 +45,6 @@ local repeatJobKey = args[8]
45
45
  local deduplicationKey = args[9]
46
46
  local parentData
47
47
  -- Includes
48
- --[[
49
- Function to debounce a job.
50
- ]]
51
- -- Includes
52
- --[[
53
- Function to remove job keys.
54
- ]]
55
- local function removeJobKeys(jobKey)
56
- return rcall("DEL", jobKey, jobKey .. ':logs', jobKey .. ':dependencies',
57
- jobKey .. ':processed', jobKey .. ':failed', jobKey .. ':unsuccessful')
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
74
- local function deduplicateJob(deduplicationOpts, jobId, delayedKey, deduplicationKey, eventsKey, maxEvents,
75
- prefix)
76
- local deduplicationId = deduplicationOpts and deduplicationOpts['id']
77
- if deduplicationId then
78
- local ttl = deduplicationOpts['ttl']
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
92
- else
93
- return currentDebounceJobId
94
- end
95
- else
96
- rcall('SET', deduplicationKey, jobId, 'PX', ttl)
97
- return
98
- end
99
- else
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
114
- end
115
- else
116
- local deduplicationKeyExists
117
- if ttl and ttl > 0 then
118
- if deduplicationOpts['extend'] then
119
- local currentDebounceJobId = rcall('GET', deduplicationKey)
120
- if currentDebounceJobId then
121
- rcall('SET', deduplicationKey, currentDebounceJobId, 'PX', ttl)
122
- rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "debounced",
123
- "jobId", currentDebounceJobId, "debounceId", deduplicationId)
124
- rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
125
- currentDebounceJobId, "deduplicationId", deduplicationId, "deduplicatedJobId", jobId)
126
- return currentDebounceJobId
127
- else
128
- rcall('SET', deduplicationKey, jobId, 'PX', ttl)
129
- return
130
- end
131
- else
132
- deduplicationKeyExists = not rcall('SET', deduplicationKey, jobId, 'PX', ttl, 'NX')
133
- end
134
- else
135
- deduplicationKeyExists = not rcall('SET', deduplicationKey, jobId, 'NX')
136
- end
137
- if deduplicationKeyExists then
138
- local currentDebounceJobId = rcall('GET', deduplicationKey)
139
- -- TODO remove debounced event in next breaking change
140
- rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "debounced", "jobId",
141
- currentDebounceJobId, "debounceId", deduplicationId)
142
- rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event", "deduplicated", "jobId",
143
- currentDebounceJobId, "deduplicationId", deduplicationId, "deduplicatedJobId", jobId)
144
- return currentDebounceJobId
145
- end
146
- end
147
- end
148
- end
149
48
  --[[
150
49
  Function to get max events value or set by default 10000.
151
50
  ]]
@@ -415,11 +314,6 @@ else
415
314
  maxEvents, timestamp)
416
315
  end
417
316
  end
418
- local deduplicationJobId = deduplicateJob(opts['de'], jobId, KEYS[3],
419
- deduplicationKey, eventsKey, maxEvents, args[1])
420
- if deduplicationJobId then
421
- return deduplicationJobId
422
- end
423
317
  -- Store the job.
424
318
  storeJob(eventsKey, jobIdKey, jobId, args[3], ARGV[2], opts, timestamp,
425
319
  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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+af,CAAC;AACW,QAAA,YAAY,GAAG;IAC1B,IAAI,EAAE,cAAc;IACpB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
1
+ {"version":3,"file":"addParentJob-6.js","sourceRoot":"","sources":["../../../src/scripts/addParentJob-6.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqUf,CAAC;AACW,QAAA,YAAY,GAAG;IAC1B,IAAI,EAAE,cAAc;IACpB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
@@ -317,11 +317,12 @@ end
317
317
  if(maxCount > 0) then
318
318
  rcall("DEL",
319
319
  baseKey .. 'events',
320
- baseKey .. 'delay',
320
+ baseKey .. 'delay',
321
321
  baseKey .. 'stalled-check',
322
322
  baseKey .. 'stalled',
323
323
  baseKey .. 'id',
324
324
  baseKey .. 'pc',
325
+ baseKey .. 'marker',
325
326
  baseKey .. 'meta',
326
327
  baseKey .. 'metrics:completed',
327
328
  baseKey .. 'metrics:completed:data',
@@ -1 +1 @@
1
- {"version":3,"file":"obliterate-2.js","sourceRoot":"","sources":["../../../src/scripts/obliterate-2.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Uf,CAAC;AACW,QAAA,UAAU,GAAG;IACxB,IAAI,EAAE,YAAY;IAClB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
1
+ {"version":3,"file":"obliterate-2.js","sourceRoot":"","sources":["../../../src/scripts/obliterate-2.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2Uf,CAAC;AACW,QAAA,UAAU,GAAG;IACxB,IAAI,EAAE,YAAY;IAClB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}