bullmq 5.52.2 → 5.52.3

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 (78) hide show
  1. package/dist/cjs/classes/flow-producer.js.map +1 -1
  2. package/dist/cjs/classes/job.js +15 -3
  3. package/dist/cjs/classes/job.js.map +1 -1
  4. package/dist/cjs/classes/scripts.js +33 -16
  5. package/dist/cjs/classes/scripts.js.map +1 -1
  6. package/dist/cjs/commands/includes/moveChildFromDependenciesIfNeeded.lua +2 -4
  7. package/dist/cjs/commands/includes/{moveJobFromPriorityToActive.lua → moveJobFromPrioritizedToActive.lua} +1 -1
  8. package/dist/cjs/commands/includes/moveParentToWait.lua +0 -3
  9. package/dist/cjs/commands/moveToActive-11.lua +2 -2
  10. package/dist/cjs/commands/moveToFinished-14.lua +13 -8
  11. package/dist/cjs/enums/error-code.js +2 -1
  12. package/dist/cjs/enums/error-code.js.map +1 -1
  13. package/dist/cjs/interfaces/index.js +1 -0
  14. package/dist/cjs/interfaces/index.js.map +1 -1
  15. package/dist/cjs/interfaces/parent-options.js +3 -0
  16. package/dist/cjs/interfaces/parent-options.js.map +1 -0
  17. package/dist/cjs/scripts/addDelayedJob-6.js +0 -2
  18. package/dist/cjs/scripts/addDelayedJob-6.js.map +1 -1
  19. package/dist/cjs/scripts/addParentJob-4.js +0 -2
  20. package/dist/cjs/scripts/addParentJob-4.js.map +1 -1
  21. package/dist/cjs/scripts/addPrioritizedJob-8.js +0 -2
  22. package/dist/cjs/scripts/addPrioritizedJob-8.js.map +1 -1
  23. package/dist/cjs/scripts/addStandardJob-8.js +0 -2
  24. package/dist/cjs/scripts/addStandardJob-8.js.map +1 -1
  25. package/dist/cjs/scripts/moveStalledJobsToWait-9.js +2 -6
  26. package/dist/cjs/scripts/moveStalledJobsToWait-9.js.map +1 -1
  27. package/dist/cjs/scripts/moveToActive-11.js +2 -2
  28. package/dist/cjs/scripts/moveToFinished-14.js +14 -14
  29. package/dist/cjs/scripts/moveToWaitingChildren-8.js +2 -6
  30. package/dist/cjs/scripts/moveToWaitingChildren-8.js.map +1 -1
  31. package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
  32. package/dist/cjs/utils.js.map +1 -1
  33. package/dist/cjs/version.js +1 -1
  34. package/dist/esm/classes/flow-producer.d.ts +3 -9
  35. package/dist/esm/classes/flow-producer.js.map +1 -1
  36. package/dist/esm/classes/job.d.ts +3 -3
  37. package/dist/esm/classes/job.js +15 -3
  38. package/dist/esm/classes/job.js.map +1 -1
  39. package/dist/esm/classes/scripts.d.ts +6 -2
  40. package/dist/esm/classes/scripts.js +33 -16
  41. package/dist/esm/classes/scripts.js.map +1 -1
  42. package/dist/esm/commands/includes/moveChildFromDependenciesIfNeeded.lua +2 -4
  43. package/dist/esm/commands/includes/{moveJobFromPriorityToActive.lua → moveJobFromPrioritizedToActive.lua} +1 -1
  44. package/dist/esm/commands/includes/moveParentToWait.lua +0 -3
  45. package/dist/esm/commands/moveToActive-11.lua +2 -2
  46. package/dist/esm/commands/moveToFinished-14.lua +13 -8
  47. package/dist/esm/enums/error-code.d.ts +3 -2
  48. package/dist/esm/enums/error-code.js +2 -1
  49. package/dist/esm/enums/error-code.js.map +1 -1
  50. package/dist/esm/interfaces/base-job-options.d.ts +3 -9
  51. package/dist/esm/interfaces/index.d.ts +1 -0
  52. package/dist/esm/interfaces/index.js +1 -0
  53. package/dist/esm/interfaces/index.js.map +1 -1
  54. package/dist/esm/interfaces/minimal-job.d.ts +2 -4
  55. package/dist/esm/interfaces/parent-options.d.ts +11 -0
  56. package/dist/esm/interfaces/parent-options.js +2 -0
  57. package/dist/esm/interfaces/parent-options.js.map +1 -0
  58. package/dist/esm/interfaces/parent.d.ts +6 -2
  59. package/dist/esm/scripts/addDelayedJob-6.js +0 -2
  60. package/dist/esm/scripts/addDelayedJob-6.js.map +1 -1
  61. package/dist/esm/scripts/addParentJob-4.js +0 -2
  62. package/dist/esm/scripts/addParentJob-4.js.map +1 -1
  63. package/dist/esm/scripts/addPrioritizedJob-8.js +0 -2
  64. package/dist/esm/scripts/addPrioritizedJob-8.js.map +1 -1
  65. package/dist/esm/scripts/addStandardJob-8.js +0 -2
  66. package/dist/esm/scripts/addStandardJob-8.js.map +1 -1
  67. package/dist/esm/scripts/moveStalledJobsToWait-9.js +2 -6
  68. package/dist/esm/scripts/moveStalledJobsToWait-9.js.map +1 -1
  69. package/dist/esm/scripts/moveToActive-11.js +2 -2
  70. package/dist/esm/scripts/moveToFinished-14.js +14 -14
  71. package/dist/esm/scripts/moveToWaitingChildren-8.js +2 -6
  72. package/dist/esm/scripts/moveToWaitingChildren-8.js.map +1 -1
  73. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  74. package/dist/esm/utils.d.ts +2 -5
  75. package/dist/esm/utils.js.map +1 -1
  76. package/dist/esm/version.d.ts +1 -1
  77. package/dist/esm/version.js +1 -1
  78. package/package.json +1 -1
@@ -1,5 +1,6 @@
1
1
  import { BackoffOptions } from './backoff-options';
2
2
  import { KeepJobs } from './keep-jobs';
3
+ import { ParentOptions } from './parent-options';
3
4
  import { RepeatOptions } from './repeat-options';
4
5
  export interface DefaultJobOptions {
5
6
  /**
@@ -83,16 +84,9 @@ export interface BaseJobOptions extends DefaultJobOptions {
83
84
  */
84
85
  jobId?: string;
85
86
  /**
86
- *
87
+ * Parent options
87
88
  */
88
- parent?: {
89
- id: string;
90
- /**
91
- * It includes the prefix, the namespace separator :, and queue name.
92
- * @see https://www.gnu.org/software/gawk/manual/html_node/Qualified-Names.html
93
- */
94
- queue: string;
95
- };
89
+ parent?: ParentOptions;
96
90
  /**
97
91
  * Internal property used by repeatable jobs.
98
92
  */
@@ -14,6 +14,7 @@ export * from './metrics';
14
14
  export * from './minimal-job';
15
15
  export * from './parent-message';
16
16
  export * from './parent';
17
+ export * from './parent-options';
17
18
  export * from './queue-options';
18
19
  export * from './rate-limiter-options';
19
20
  export * from './redis-options';
@@ -14,6 +14,7 @@ export * from './metrics';
14
14
  export * from './minimal-job';
15
15
  export * from './parent-message';
16
16
  export * from './parent';
17
+ export * from './parent-options';
17
18
  export * from './queue-options';
18
19
  export * from './rate-limiter-options';
19
20
  export * from './redis-options';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { JobsOptions, JobJsonSandbox, JobProgress } from '../types';
2
2
  import { JobJson } from './job-json';
3
3
  import { ParentKeys } from './parent';
4
+ import { ParentOptions } from './parent-options';
4
5
  export type BulkJobOptions = Omit<JobsOptions, 'repeat'>;
5
6
  export interface MoveToDelayedOpts {
6
7
  skipAttempt?: boolean;
@@ -10,10 +11,7 @@ export interface RetryJobOpts {
10
11
  fieldsToUpdate?: Record<string, any>;
11
12
  }
12
13
  export interface MoveToWaitingChildrenOpts {
13
- child?: {
14
- id: string;
15
- queue: string;
16
- };
14
+ child?: ParentOptions;
17
15
  }
18
16
  export interface DependencyOpts {
19
17
  /**
@@ -0,0 +1,11 @@
1
+ export type ParentOptions = {
2
+ /**
3
+ * Parent identifier.
4
+ */
5
+ id: string;
6
+ /**
7
+ * It includes the prefix, the namespace separator :, and queue name.
8
+ * @see {@link https://www.gnu.org/software/gawk/manual/html_node/Qualified-Names.html}
9
+ */
10
+ queue: string;
11
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=parent-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parent-options.js","sourceRoot":"","sources":["../../../src/interfaces/parent-options.ts"],"names":[],"mappings":""}
@@ -10,10 +10,14 @@ export interface Parent<T> {
10
10
  opts?: JobsOptions;
11
11
  }
12
12
  export interface ParentKeys {
13
- id: string;
13
+ id?: string;
14
14
  queueKey: string;
15
+ fpof?: boolean;
16
+ rdof?: boolean;
17
+ idof?: boolean;
18
+ cpof?: boolean;
15
19
  }
16
- export type ParentOpts = {
20
+ export type ParentKeyOpts = {
17
21
  waitChildrenKey?: string;
18
22
  parentDependenciesKey?: string;
19
23
  parentKey?: string;
@@ -249,8 +249,6 @@ local function moveParentToWait(parentQueueKey, parentKey, parentId, timestamp)
249
249
  local jobAttributes = rcall("HMGET", parentKey, "priority", "delay")
250
250
  local priority = tonumber(jobAttributes[1]) or 0
251
251
  local delay = tonumber(jobAttributes[2]) or 0
252
- -- ignore dependencies if any left
253
- rcall("HSET", parentKey, "igdp", 1)
254
252
  if delay > 0 then
255
253
  local delayedTimestamp = tonumber(timestamp) + delay
256
254
  local score = delayedTimestamp * 0x1000
@@ -1 +1 @@
1
- {"version":3,"file":"addDelayedJob-6.js","sourceRoot":"","sources":["../../../src/scripts/addDelayedJob-6.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2Yf,CAAC;AACF,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,eAAe;IACrB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
1
+ {"version":3,"file":"addDelayedJob-6.js","sourceRoot":"","sources":["../../../src/scripts/addDelayedJob-6.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyYf,CAAC;AACF,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,eAAe;IACrB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
@@ -205,8 +205,6 @@ local function moveParentToWait(parentQueueKey, parentKey, parentId, timestamp)
205
205
  local jobAttributes = rcall("HMGET", parentKey, "priority", "delay")
206
206
  local priority = tonumber(jobAttributes[1]) or 0
207
207
  local delay = tonumber(jobAttributes[2]) or 0
208
- -- ignore dependencies if any left
209
- rcall("HSET", parentKey, "igdp", 1)
210
208
  if delay > 0 then
211
209
  local delayedTimestamp = tonumber(timestamp) + delay
212
210
  local score = delayedTimestamp * 0x1000
@@ -1 +1 @@
1
- {"version":3,"file":"addParentJob-4.js","sourceRoot":"","sources":["../../../src/scripts/addParentJob-4.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkWf,CAAC;AACF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,cAAc;IACpB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
1
+ {"version":3,"file":"addParentJob-4.js","sourceRoot":"","sources":["../../../src/scripts/addParentJob-4.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgWf,CAAC;AACF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,cAAc;IACpB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
@@ -242,8 +242,6 @@ local function moveParentToWait(parentQueueKey, parentKey, parentId, timestamp)
242
242
  local jobAttributes = rcall("HMGET", parentKey, "priority", "delay")
243
243
  local priority = tonumber(jobAttributes[1]) or 0
244
244
  local delay = tonumber(jobAttributes[2]) or 0
245
- -- ignore dependencies if any left
246
- rcall("HSET", parentKey, "igdp", 1)
247
245
  if delay > 0 then
248
246
  local delayedTimestamp = tonumber(timestamp) + delay
249
247
  local score = delayedTimestamp * 0x1000
@@ -1 +1 @@
1
- {"version":3,"file":"addPrioritizedJob-8.js","sourceRoot":"","sources":["../../../src/scripts/addPrioritizedJob-8.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4Wf,CAAC;AACF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,mBAAmB;IACzB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
1
+ {"version":3,"file":"addPrioritizedJob-8.js","sourceRoot":"","sources":["../../../src/scripts/addPrioritizedJob-8.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Wf,CAAC;AACF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,mBAAmB;IACzB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
@@ -215,8 +215,6 @@ local function moveParentToWait(parentQueueKey, parentKey, parentId, timestamp)
215
215
  local jobAttributes = rcall("HMGET", parentKey, "priority", "delay")
216
216
  local priority = tonumber(jobAttributes[1]) or 0
217
217
  local delay = tonumber(jobAttributes[2]) or 0
218
- -- ignore dependencies if any left
219
- rcall("HSET", parentKey, "igdp", 1)
220
218
  if delay > 0 then
221
219
  local delayedTimestamp = tonumber(timestamp) + delay
222
220
  local score = delayedTimestamp * 0x1000
@@ -1 +1 @@
1
- {"version":3,"file":"addStandardJob-8.js","sourceRoot":"","sources":["../../../src/scripts/addStandardJob-8.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgXf,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,gBAAgB;IACtB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
1
+ {"version":3,"file":"addStandardJob-8.js","sourceRoot":"","sources":["../../../src/scripts/addStandardJob-8.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8Wf,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,gBAAgB;IACtB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
@@ -154,8 +154,6 @@ local function moveParentToWait(parentQueueKey, parentKey, parentId, timestamp)
154
154
  local jobAttributes = rcall("HMGET", parentKey, "priority", "delay")
155
155
  local priority = tonumber(jobAttributes[1]) or 0
156
156
  local delay = tonumber(jobAttributes[2]) or 0
157
- -- ignore dependencies if any left
158
- rcall("HSET", parentKey, "igdp", 1)
159
157
  if delay > 0 then
160
158
  local delayedTimestamp = tonumber(timestamp) + delay
161
159
  local score = delayedTimestamp * 0x1000
@@ -369,9 +367,7 @@ local function removeJobsOnFail(queueKeyPrefix, failedKey, jobId, opts, timestam
369
367
  end
370
368
  end
371
369
  end
372
- local moveParentToFailedIfNeeded
373
- local moveChildFromDependenciesIfNeeded
374
- moveParentToFailedIfNeeded = function (parentQueueKey, parentKey, parentId, jobIdKey, timestamp)
370
+ local moveParentToFailedIfNeeded = function (parentQueueKey, parentKey, parentId, jobIdKey, timestamp)
375
371
  if rcall("EXISTS", parentKey) == 1 then
376
372
  local parentWaitingChildrenKey = parentQueueKey .. ":waiting-children"
377
373
  local parentDelayedKey = parentQueueKey .. ":delayed"
@@ -401,7 +397,7 @@ moveParentToFailedIfNeeded = function (parentQueueKey, parentKey, parentId, jobI
401
397
  end
402
398
  end
403
399
  end
404
- moveChildFromDependenciesIfNeeded = function (rawParentData, childKey, failedReason, timestamp)
400
+ local moveChildFromDependenciesIfNeeded = function (rawParentData, childKey, failedReason, timestamp)
405
401
  if rawParentData then
406
402
  local parentData = cjson.decode(rawParentData)
407
403
  local parentKey = parentData['queueKey'] .. ':' .. parentData['id']
@@ -1 +1 @@
1
- {"version":3,"file":"moveStalledJobsToWait-9.js","sourceRoot":"","sources":["../../../src/scripts/moveStalledJobsToWait-9.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6iBf,CAAC;AACF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,uBAAuB;IAC7B,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
1
+ {"version":3,"file":"moveStalledJobsToWait-9.js","sourceRoot":"","sources":["../../../src/scripts/moveStalledJobsToWait-9.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyiBf,CAAC;AACF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,uBAAuB;IAC7B,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
@@ -86,7 +86,7 @@ end
86
86
  --[[
87
87
  Function to move job from prioritized state to active.
88
88
  ]]
89
- local function moveJobFromPriorityToActive(priorityKey, activeKey, priorityCounterKey)
89
+ local function moveJobFromPrioritizedToActive(priorityKey, activeKey, priorityCounterKey)
90
90
  local prioritizedJob = rcall("ZPOPMIN", priorityKey)
91
91
  if #prioritizedJob > 0 then
92
92
  rcall("LPUSH", activeKey, prioritizedJob[1])
@@ -219,7 +219,7 @@ if jobId then
219
219
  return prepareJobForProcessing(ARGV[1], rateLimiterKey, eventStreamKey, jobId, ARGV[2],
220
220
  maxJobs, markerKey, opts)
221
221
  else
222
- jobId = moveJobFromPriorityToActive(KEYS[3], activeKey, KEYS[10])
222
+ jobId = moveJobFromPrioritizedToActive(KEYS[3], activeKey, KEYS[10])
223
223
  if jobId then
224
224
  return prepareJobForProcessing(ARGV[1], rateLimiterKey, eventStreamKey, jobId, ARGV[2],
225
225
  maxJobs, markerKey, opts)
@@ -43,8 +43,9 @@ const content = `--[[
43
43
  -1 Missing key.
44
44
  -2 Missing lock.
45
45
  -3 Job not in active set
46
- -4 Job has pending dependencies
46
+ -4 Job has pending children
47
47
  -6 Lock is not owned by this client
48
+ -9 Job has failed children
48
49
  Events:
49
50
  'completed/failed'
50
51
  ]]
@@ -154,7 +155,7 @@ end
154
155
  --[[
155
156
  Function to move job from prioritized state to active.
156
157
  ]]
157
- local function moveJobFromPriorityToActive(priorityKey, activeKey, priorityCounterKey)
158
+ local function moveJobFromPrioritizedToActive(priorityKey, activeKey, priorityCounterKey)
158
159
  local prioritizedJob = rcall("ZPOPMIN", priorityKey)
159
160
  if #prioritizedJob > 0 then
160
161
  rcall("LPUSH", activeKey, prioritizedJob[1])
@@ -250,8 +251,6 @@ local function moveParentToWait(parentQueueKey, parentKey, parentId, timestamp)
250
251
  local jobAttributes = rcall("HMGET", parentKey, "priority", "delay")
251
252
  local priority = tonumber(jobAttributes[1]) or 0
252
253
  local delay = tonumber(jobAttributes[2]) or 0
253
- -- ignore dependencies if any left
254
- rcall("HSET", parentKey, "igdp", 1)
255
254
  if delay > 0 then
256
255
  local delayedTimestamp = tonumber(timestamp) + delay
257
256
  local score = delayedTimestamp * 0x1000
@@ -465,9 +464,7 @@ local function removeJobsOnFail(queueKeyPrefix, failedKey, jobId, opts, timestam
465
464
  end
466
465
  end
467
466
  end
468
- local moveParentToFailedIfNeeded
469
- local moveChildFromDependenciesIfNeeded
470
- moveParentToFailedIfNeeded = function (parentQueueKey, parentKey, parentId, jobIdKey, timestamp)
467
+ local moveParentToFailedIfNeeded = function (parentQueueKey, parentKey, parentId, jobIdKey, timestamp)
471
468
  if rcall("EXISTS", parentKey) == 1 then
472
469
  local parentWaitingChildrenKey = parentQueueKey .. ":waiting-children"
473
470
  local parentDelayedKey = parentQueueKey .. ":delayed"
@@ -497,7 +494,7 @@ moveParentToFailedIfNeeded = function (parentQueueKey, parentKey, parentId, jobI
497
494
  end
498
495
  end
499
496
  end
500
- moveChildFromDependenciesIfNeeded = function (rawParentData, childKey, failedReason, timestamp)
497
+ local moveChildFromDependenciesIfNeeded = function (rawParentData, childKey, failedReason, timestamp)
501
498
  if rawParentData then
502
499
  local parentData = cjson.decode(rawParentData)
503
500
  local parentKey = parentData['queueKey'] .. ':' .. parentData['id']
@@ -688,10 +685,13 @@ local jobIdKey = KEYS[12]
688
685
  if rcall("EXISTS", jobIdKey) == 1 then -- Make sure job exists
689
686
  -- Make sure it does not have pending dependencies
690
687
  -- It must happen before removing lock
691
- if ARGV[5] == "completed" and
692
- not rcall("HGET", jobIdKey, "igdp") and -- check if we should ignore this check
693
- rcall("SCARD", jobIdKey .. ":dependencies") ~= 0 then
694
- return -4
688
+ if ARGV[5] == "completed" then
689
+ if rcall("SCARD", jobIdKey .. ":dependencies") ~= 0 then
690
+ return -4
691
+ end
692
+ if rcall("ZCARD", jobIdKey .. ":unsuccessful") ~= 0 then
693
+ return -9
694
+ end
695
695
  end
696
696
  local opts = cmsgpack.unpack(ARGV[8])
697
697
  local token = opts['token']
@@ -810,7 +810,7 @@ if rcall("EXISTS", jobIdKey) == 1 then -- Make sure job exists
810
810
  -- If jobId is special ID 0:delay (delay greater than 0), then there is no job to process
811
811
  -- but if ID is 0:0, then there is at least 1 prioritized job to process
812
812
  if jobId == "0:0" then
813
- jobId = moveJobFromPriorityToActive(KEYS[3], KEYS[2], KEYS[10])
813
+ jobId = moveJobFromPrioritizedToActive(KEYS[3], KEYS[2], KEYS[10])
814
814
  return prepareJobForProcessing(prefix, KEYS[6], eventStreamKey, jobId, timestamp, maxJobs,
815
815
  markerKey, opts)
816
816
  end
@@ -819,7 +819,7 @@ if rcall("EXISTS", jobIdKey) == 1 then -- Make sure job exists
819
819
  opts)
820
820
  end
821
821
  else
822
- jobId = moveJobFromPriorityToActive(KEYS[3], KEYS[2], KEYS[10])
822
+ jobId = moveJobFromPrioritizedToActive(KEYS[3], KEYS[2], KEYS[10])
823
823
  if jobId then
824
824
  return prepareJobForProcessing(prefix, KEYS[6], eventStreamKey, jobId, timestamp, maxJobs, markerKey,
825
825
  opts)
@@ -151,8 +151,6 @@ local function moveParentToWait(parentQueueKey, parentKey, parentId, timestamp)
151
151
  local jobAttributes = rcall("HMGET", parentKey, "priority", "delay")
152
152
  local priority = tonumber(jobAttributes[1]) or 0
153
153
  local delay = tonumber(jobAttributes[2]) or 0
154
- -- ignore dependencies if any left
155
- rcall("HSET", parentKey, "igdp", 1)
156
154
  if delay > 0 then
157
155
  local delayedTimestamp = tonumber(timestamp) + delay
158
156
  local score = delayedTimestamp * 0x1000
@@ -366,9 +364,7 @@ local function removeJobsOnFail(queueKeyPrefix, failedKey, jobId, opts, timestam
366
364
  end
367
365
  end
368
366
  end
369
- local moveParentToFailedIfNeeded
370
- local moveChildFromDependenciesIfNeeded
371
- moveParentToFailedIfNeeded = function (parentQueueKey, parentKey, parentId, jobIdKey, timestamp)
367
+ local moveParentToFailedIfNeeded = function (parentQueueKey, parentKey, parentId, jobIdKey, timestamp)
372
368
  if rcall("EXISTS", parentKey) == 1 then
373
369
  local parentWaitingChildrenKey = parentQueueKey .. ":waiting-children"
374
370
  local parentDelayedKey = parentQueueKey .. ":delayed"
@@ -398,7 +394,7 @@ moveParentToFailedIfNeeded = function (parentQueueKey, parentKey, parentId, jobI
398
394
  end
399
395
  end
400
396
  end
401
- moveChildFromDependenciesIfNeeded = function (rawParentData, childKey, failedReason, timestamp)
397
+ local moveChildFromDependenciesIfNeeded = function (rawParentData, childKey, failedReason, timestamp)
402
398
  if rawParentData then
403
399
  local parentData = cjson.decode(rawParentData)
404
400
  local parentKey = parentData['queueKey'] .. ':' .. parentData['id']
@@ -1 +1 @@
1
- {"version":3,"file":"moveToWaitingChildren-8.js","sourceRoot":"","sources":["../../../src/scripts/moveToWaitingChildren-8.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2gBf,CAAC;AACF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,uBAAuB;IAC7B,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
1
+ {"version":3,"file":"moveToWaitingChildren-8.js","sourceRoot":"","sources":["../../../src/scripts/moveToWaitingChildren-8.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAugBf,CAAC;AACF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,uBAAuB;IAC7B,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}