bullmq 5.1.12 → 5.2.1

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.
Files changed (47) hide show
  1. package/dist/cjs/classes/job.js +10 -0
  2. package/dist/cjs/classes/job.js.map +1 -1
  3. package/dist/cjs/classes/scripts.js +3 -2
  4. package/dist/cjs/classes/scripts.js.map +1 -1
  5. package/dist/cjs/commands/includes/removeJob.lua +2 -2
  6. package/dist/cjs/commands/includes/removeJobKeys.lua +8 -0
  7. package/dist/cjs/commands/includes/removeParentDependencyKey.lua +4 -5
  8. package/dist/cjs/commands/moveToFinished-14.lua +13 -4
  9. package/dist/cjs/commands/removeJob-1.lua +12 -1
  10. package/dist/cjs/scripts/cleanJobsInSet-2.js +11 -7
  11. package/dist/cjs/scripts/cleanJobsInSet-2.js.map +1 -1
  12. package/dist/cjs/scripts/drain-4.js +11 -7
  13. package/dist/cjs/scripts/drain-4.js.map +1 -1
  14. package/dist/cjs/scripts/moveStalledJobsToWait-9.js +11 -7
  15. package/dist/cjs/scripts/moveStalledJobsToWait-9.js.map +1 -1
  16. package/dist/cjs/scripts/moveToFinished-14.js +65 -53
  17. package/dist/cjs/scripts/moveToFinished-14.js.map +1 -1
  18. package/dist/cjs/scripts/obliterate-2.js +11 -7
  19. package/dist/cjs/scripts/obliterate-2.js.map +1 -1
  20. package/dist/cjs/scripts/removeJob-1.js +19 -6
  21. package/dist/cjs/scripts/removeJob-1.js.map +1 -1
  22. package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
  23. package/dist/esm/classes/job.d.ts +9 -1
  24. package/dist/esm/classes/job.js +10 -0
  25. package/dist/esm/classes/job.js.map +1 -1
  26. package/dist/esm/classes/scripts.js +3 -2
  27. package/dist/esm/classes/scripts.js.map +1 -1
  28. package/dist/esm/commands/includes/removeJob.lua +2 -2
  29. package/dist/esm/commands/includes/removeJobKeys.lua +8 -0
  30. package/dist/esm/commands/includes/removeParentDependencyKey.lua +4 -5
  31. package/dist/esm/commands/moveToFinished-14.lua +13 -4
  32. package/dist/esm/commands/removeJob-1.lua +12 -1
  33. package/dist/esm/scripts/cleanJobsInSet-2.js +11 -7
  34. package/dist/esm/scripts/cleanJobsInSet-2.js.map +1 -1
  35. package/dist/esm/scripts/drain-4.js +11 -7
  36. package/dist/esm/scripts/drain-4.js.map +1 -1
  37. package/dist/esm/scripts/moveStalledJobsToWait-9.js +11 -7
  38. package/dist/esm/scripts/moveStalledJobsToWait-9.js.map +1 -1
  39. package/dist/esm/scripts/moveToFinished-14.js +65 -53
  40. package/dist/esm/scripts/moveToFinished-14.js.map +1 -1
  41. package/dist/esm/scripts/obliterate-2.js +11 -7
  42. package/dist/esm/scripts/obliterate-2.js.map +1 -1
  43. package/dist/esm/scripts/removeJob-1.js +19 -6
  44. package/dist/esm/scripts/removeJob-1.js.map +1 -1
  45. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  46. package/dist/esm/types/job-options.d.ts +8 -0
  47. package/package.json +1 -1
@@ -36,6 +36,7 @@ const content = `--[[
36
36
  opts - attempts max attempts
37
37
  opts - maxMetricsSize
38
38
  opts - fpof - fail parent on fail
39
+ opts - idof - ignore dependency on fail
39
40
  opts - rdof - remove dependency on fail
40
41
  Output:
41
42
  0 OK
@@ -116,6 +117,21 @@ local function getNextDelayedTimestamp(delayedKey)
116
117
  return nextTimestamp
117
118
  end
118
119
  end
120
+ --[[
121
+ Function to get current rate limit ttl.
122
+ ]]
123
+ local function getRateLimitTTL(maxJobs, rateLimiterKey)
124
+ if maxJobs and maxJobs <= tonumber(rcall("GET", rateLimiterKey) or 0) then
125
+ local pttl = rcall("PTTL", rateLimiterKey)
126
+ if pttl == 0 then
127
+ rcall("DEL", rateLimiterKey)
128
+ end
129
+ if pttl > 0 then
130
+ return pttl
131
+ end
132
+ end
133
+ return 0
134
+ end
119
135
  --[[
120
136
  Function to check for the meta.paused key to decide if we are paused or not
121
137
  (since an empty list and !EXISTS are not really the same).
@@ -139,35 +155,6 @@ local function moveJobFromPriorityToActive(priorityKey, activeKey, priorityCount
139
155
  rcall("DEL", priorityCounterKey)
140
156
  end
141
157
  end
142
- --[[
143
- Function to move job from wait state to active.
144
- Input:
145
- opts - token - lock token
146
- opts - lockDuration
147
- opts - limiter
148
- ]]
149
- local function prepareJobForProcessing(keyPrefix, rateLimiterKey, eventStreamKey,
150
- jobId, processedOn, maxJobs, opts)
151
- local jobKey = keyPrefix .. jobId
152
- -- Check if we need to perform rate limiting.
153
- if maxJobs then
154
- local jobCounter = tonumber(rcall("INCR", rateLimiterKey))
155
- if jobCounter == 1 then
156
- local limiterDuration = opts['limiter'] and opts['limiter']['duration']
157
- local integerDuration = math.floor(math.abs(limiterDuration))
158
- rcall("PEXPIRE", rateLimiterKey, integerDuration)
159
- end
160
- end
161
- local lockKey = jobKey .. ':lock'
162
- -- get a lock
163
- if opts['token'] ~= "0" then
164
- rcall("SET", lockKey, opts['token'], "PX", opts['lockDuration'])
165
- end
166
- rcall("XADD", eventStreamKey, "*", "event", "active", "jobId", jobId, "prev", "waiting")
167
- rcall("HSET", jobKey, "processedOn", processedOn)
168
- rcall("HINCRBY", jobKey, "ats", 1)
169
- return {rcall("HGETALL", jobKey), jobId, 0, 0} -- get job data
170
- end
171
158
  --[[
172
159
  Function to recursively move from waitingChildren to failed.
173
160
  ]]
@@ -288,6 +275,35 @@ local function moveParentFromWaitingChildrenToFailed( parentQueueKey, parentKey,
288
275
  end
289
276
  end
290
277
  end
278
+ --[[
279
+ Function to move job from wait state to active.
280
+ Input:
281
+ opts - token - lock token
282
+ opts - lockDuration
283
+ opts - limiter
284
+ ]]
285
+ local function prepareJobForProcessing(keyPrefix, rateLimiterKey, eventStreamKey,
286
+ jobId, processedOn, maxJobs, opts)
287
+ local jobKey = keyPrefix .. jobId
288
+ -- Check if we need to perform rate limiting.
289
+ if maxJobs then
290
+ local jobCounter = tonumber(rcall("INCR", rateLimiterKey))
291
+ if jobCounter == 1 then
292
+ local limiterDuration = opts['limiter'] and opts['limiter']['duration']
293
+ local integerDuration = math.floor(math.abs(limiterDuration))
294
+ rcall("PEXPIRE", rateLimiterKey, integerDuration)
295
+ end
296
+ end
297
+ local lockKey = jobKey .. ':lock'
298
+ -- get a lock
299
+ if opts['token'] ~= "0" then
300
+ rcall("SET", lockKey, opts['token'], "PX", opts['lockDuration'])
301
+ end
302
+ rcall("XADD", eventStreamKey, "*", "event", "active", "jobId", jobId, "prev", "waiting")
303
+ rcall("HSET", jobKey, "processedOn", processedOn)
304
+ rcall("HINCRBY", jobKey, "ats", 1)
305
+ return {rcall("HGETALL", jobKey), jobId, 0, 0} -- get job data
306
+ end
291
307
  --[[
292
308
  Updates the delay set, by moving delayed jobs that should
293
309
  be processed now to "wait".
@@ -319,6 +335,13 @@ local function promoteDelayedJobs(delayedKey, markerKey, targetKey, prioritizedK
319
335
  end
320
336
  end
321
337
  end
338
+ --[[
339
+ Function to remove job keys.
340
+ ]]
341
+ local function removeJobKeys(jobKey)
342
+ return rcall("DEL", jobKey, jobKey .. ':logs',
343
+ jobKey .. ':dependencies', jobKey .. ':processed', jobKey .. ':failed')
344
+ end
322
345
  --[[
323
346
  Functions to remove jobs by max age.
324
347
  ]]
@@ -363,11 +386,10 @@ local function removeParentDependencyKey(jobKey, hard, parentKey, baseKey)
363
386
  local parentPrefix = getJobKeyPrefix(parentKey, parentId)
364
387
  local numRemovedElements = rcall("ZREM", parentPrefix .. "waiting-children", parentId)
365
388
  if numRemovedElements == 1 then
366
- if hard then
389
+ if hard then -- remove parent in same queue
367
390
  if parentPrefix == baseKey then
368
391
  removeParentDependencyKey(parentKey, hard, nil, baseKey)
369
- rcall("DEL", parentKey, parentKey .. ':logs',
370
- parentKey .. ':dependencies', parentKey .. ':processed')
392
+ removeJobKeys(parentKey)
371
393
  else
372
394
  moveParentToWait(parentPrefix, parentId)
373
395
  end
@@ -393,8 +415,7 @@ local function removeParentDependencyKey(jobKey, hard, parentKey, baseKey)
393
415
  if hard then
394
416
  if parentPrefix == baseKey then
395
417
  removeParentDependencyKey(missedParentKey, hard, nil, baseKey)
396
- rcall("DEL", missedParentKey, missedParentKey .. ':logs',
397
- missedParentKey .. ':dependencies', missedParentKey .. ':processed')
418
+ removeJobKeys(missedParentKey)
398
419
  else
399
420
  moveParentToWait(parentPrefix, parentId)
400
421
  end
@@ -410,8 +431,7 @@ end
410
431
  local function removeJob(jobId, hard, baseKey)
411
432
  local jobKey = baseKey .. jobId
412
433
  removeParentDependencyKey(jobKey, hard, nil, baseKey)
413
- rcall("DEL", jobKey, jobKey .. ':logs',
414
- jobKey .. ':dependencies', jobKey .. ':processed')
434
+ removeJobKeys(jobKey)
415
435
  end
416
436
  local function removeJobsByMaxAge(timestamp, maxAge, targetSet, prefix)
417
437
  local start = timestamp - maxAge * 1000
@@ -466,21 +486,6 @@ local function updateParentDepsIfNeeded(parentKey, parentQueueKey, parentDepende
466
486
  rcall("HSET", processedSet, jobIdKey, returnvalue)
467
487
  moveParentToWaitIfNeeded(parentQueueKey, parentDependenciesKey, parentKey, parentId, timestamp)
468
488
  end
469
- --[[
470
- Function to get current rate limit ttl.
471
- ]]
472
- local function getRateLimitTTL(maxJobs, rateLimiterKey)
473
- if maxJobs and maxJobs <= tonumber(rcall("GET", rateLimiterKey) or 0) then
474
- local pttl = rcall("PTTL", rateLimiterKey)
475
- if pttl == 0 then
476
- rcall("DEL", rateLimiterKey)
477
- end
478
- if pttl > 0 then
479
- return pttl
480
- end
481
- end
482
- return 0
483
- end
484
489
  local jobIdKey = KEYS[12]
485
490
  if rcall("EXISTS", jobIdKey) == 1 then -- // Make sure job exists
486
491
  local opts = cmsgpack.unpack(ARGV[8])
@@ -548,11 +553,15 @@ if rcall("EXISTS", jobIdKey) == 1 then -- // Make sure job exists
548
553
  moveParentFromWaitingChildrenToFailed(parentQueueKey, parentKey,
549
554
  parentId, jobIdKey,
550
555
  timestamp)
551
- elseif opts['rdof'] then
556
+ elseif opts['idof'] or opts['rdof'] then
552
557
  local dependenciesSet = parentKey .. ":dependencies"
553
558
  if rcall("SREM", dependenciesSet, jobIdKey) == 1 then
554
559
  moveParentToWaitIfNeeded(parentQueueKey, dependenciesSet,
555
560
  parentKey, parentId, timestamp)
561
+ if opts['idof'] then
562
+ local failedSet = parentKey .. ":failed"
563
+ rcall("HSET", failedSet, jobIdKey, ARGV[4])
564
+ end
556
565
  end
557
566
  end
558
567
  end
@@ -574,8 +583,11 @@ if rcall("EXISTS", jobIdKey) == 1 then -- // Make sure job exists
574
583
  removeJobsByMaxCount(maxCount, targetSet, prefix)
575
584
  end
576
585
  else
577
- rcall("DEL", jobIdKey, jobIdKey .. ':logs', jobIdKey .. ':processed')
586
+ removeJobKeys(jobIdKey)
578
587
  if parentKey ~= "" then
588
+ -- TODO: when a child is removed when finished, result or failure in parent
589
+ -- must not be deleted, those value references should be deleted when the parent
590
+ -- is deleted
579
591
  removeParentDependencyKey(jobIdKey, false, parentKey)
580
592
  end
581
593
  end
@@ -1 +1 @@
1
- {"version":3,"file":"moveToFinished-14.js","sourceRoot":"","sources":["../../../src/scripts/moveToFinished-14.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4oBf,CAAC;AACW,QAAA,cAAc,GAAG;IAC5B,IAAI,EAAE,gBAAgB;IACtB,OAAO;IACP,IAAI,EAAE,EAAE;CACT,CAAC"}
1
+ {"version":3,"file":"moveToFinished-14.js","sourceRoot":"","sources":["../../../src/scripts/moveToFinished-14.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwpBf,CAAC;AACW,QAAA,cAAc,GAAG;IAC5B,IAAI,EAAE,gBAAgB;IACtB,OAAO;IACP,IAAI,EAAE,EAAE;CACT,CAAC"}
@@ -27,6 +27,13 @@ local rcall = redis.call
27
27
  Function to remove job.
28
28
  ]]
29
29
  -- Includes
30
+ --[[
31
+ Function to remove job keys.
32
+ ]]
33
+ local function removeJobKeys(jobKey)
34
+ return rcall("DEL", jobKey, jobKey .. ':logs',
35
+ jobKey .. ':dependencies', jobKey .. ':processed', jobKey .. ':failed')
36
+ end
30
37
  --[[
31
38
  Check if this job has a parent. If so we will just remove it from
32
39
  the parent child list, but if it is the last child we should move the parent to "wait/paused"
@@ -90,11 +97,10 @@ local function removeParentDependencyKey(jobKey, hard, parentKey, baseKey)
90
97
  local parentPrefix = getJobKeyPrefix(parentKey, parentId)
91
98
  local numRemovedElements = rcall("ZREM", parentPrefix .. "waiting-children", parentId)
92
99
  if numRemovedElements == 1 then
93
- if hard then
100
+ if hard then -- remove parent in same queue
94
101
  if parentPrefix == baseKey then
95
102
  removeParentDependencyKey(parentKey, hard, nil, baseKey)
96
- rcall("DEL", parentKey, parentKey .. ':logs',
97
- parentKey .. ':dependencies', parentKey .. ':processed')
103
+ removeJobKeys(parentKey)
98
104
  else
99
105
  moveParentToWait(parentPrefix, parentId)
100
106
  end
@@ -120,8 +126,7 @@ local function removeParentDependencyKey(jobKey, hard, parentKey, baseKey)
120
126
  if hard then
121
127
  if parentPrefix == baseKey then
122
128
  removeParentDependencyKey(missedParentKey, hard, nil, baseKey)
123
- rcall("DEL", missedParentKey, missedParentKey .. ':logs',
124
- missedParentKey .. ':dependencies', missedParentKey .. ':processed')
129
+ removeJobKeys(missedParentKey)
125
130
  else
126
131
  moveParentToWait(parentPrefix, parentId)
127
132
  end
@@ -137,8 +142,7 @@ end
137
142
  local function removeJob(jobId, hard, baseKey)
138
143
  local jobKey = baseKey .. jobId
139
144
  removeParentDependencyKey(jobKey, hard, nil, baseKey)
140
- rcall("DEL", jobKey, jobKey .. ':logs',
141
- jobKey .. ':dependencies', jobKey .. ':processed')
145
+ removeJobKeys(jobKey)
142
146
  end
143
147
  local function removeJobs(keys, hard, baseKey, max)
144
148
  for i, key in ipairs(keys) do
@@ -1 +1 @@
1
- {"version":3,"file":"obliterate-2.js","sourceRoot":"","sources":["../../../src/scripts/obliterate-2.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiQf,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqQf,CAAC;AACW,QAAA,UAAU,GAAG;IACxB,IAAI,EAAE,YAAY;IAClB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
@@ -96,6 +96,13 @@ local function removeJobFromAnyState( prefix, jobId)
96
96
  end
97
97
  return "unknown"
98
98
  end
99
+ --[[
100
+ Function to remove job keys.
101
+ ]]
102
+ local function removeJobKeys(jobKey)
103
+ return rcall("DEL", jobKey, jobKey .. ':logs',
104
+ jobKey .. ':dependencies', jobKey .. ':processed', jobKey .. ':failed')
105
+ end
99
106
  --[[
100
107
  Check if this job has a parent. If so we will just remove it from
101
108
  the parent child list, but if it is the last child we should move the parent to "wait/paused"
@@ -149,11 +156,10 @@ local function removeParentDependencyKey(jobKey, hard, parentKey, baseKey)
149
156
  local parentPrefix = getJobKeyPrefix(parentKey, parentId)
150
157
  local numRemovedElements = rcall("ZREM", parentPrefix .. "waiting-children", parentId)
151
158
  if numRemovedElements == 1 then
152
- if hard then
159
+ if hard then -- remove parent in same queue
153
160
  if parentPrefix == baseKey then
154
161
  removeParentDependencyKey(parentKey, hard, nil, baseKey)
155
- rcall("DEL", parentKey, parentKey .. ':logs',
156
- parentKey .. ':dependencies', parentKey .. ':processed')
162
+ removeJobKeys(parentKey)
157
163
  else
158
164
  moveParentToWait(parentPrefix, parentId)
159
165
  end
@@ -179,8 +185,7 @@ local function removeParentDependencyKey(jobKey, hard, parentKey, baseKey)
179
185
  if hard then
180
186
  if parentPrefix == baseKey then
181
187
  removeParentDependencyKey(missedParentKey, hard, nil, baseKey)
182
- rcall("DEL", missedParentKey, missedParentKey .. ':logs',
183
- missedParentKey .. ':dependencies', missedParentKey .. ':processed')
188
+ removeJobKeys(missedParentKey)
184
189
  else
185
190
  moveParentToWait(parentPrefix, parentId)
186
191
  end
@@ -218,9 +223,17 @@ local function removeJob( prefix, jobId, parentKey, removeChildren)
218
223
  removeJob( childJobPrefix, childJobId, jobKey, removeChildren )
219
224
  end
220
225
  end
226
+ local failed = rcall("HGETALL", jobKey .. ":failed")
227
+ if (#failed > 0) then
228
+ for i = 1, #failed, 2 do
229
+ local childJobId = getJobIdFromKey(failed[i])
230
+ local childJobPrefix = getJobKeyPrefix(failed[i], childJobId)
231
+ removeJob( childJobPrefix, childJobId, jobKey, removeChildren )
232
+ end
233
+ end
221
234
  end
222
235
  local prev = removeJobFromAnyState(prefix, jobId)
223
- if rcall("DEL", jobKey, jobKey .. ":logs", jobKey .. ":dependencies", jobKey .. ":processed") > 0 then
236
+ if removeJobKeys(jobKey) > 0 then
224
237
  local maxEvents = getOrSetMaxEvents(prefix .. "meta")
225
238
  rcall("XADD", prefix .. "events", "MAXLEN", "~", maxEvents, "*", "event", "removed",
226
239
  "jobId", jobId, "prev", prev)
@@ -1 +1 @@
1
- {"version":3,"file":"removeJob-1.js","sourceRoot":"","sources":["../../../src/scripts/removeJob-1.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuOf,CAAC;AACW,QAAA,SAAS,GAAG;IACvB,IAAI,EAAE,WAAW;IACjB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
1
+ {"version":3,"file":"removeJob-1.js","sourceRoot":"","sources":["../../../src/scripts/removeJob-1.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoPf,CAAC;AACW,QAAA,SAAS,GAAG;IACvB,IAAI,EAAE,WAAW;IACjB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}