bullmq 5.41.2 → 5.41.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.
Files changed (56) hide show
  1. package/dist/cjs/classes/worker.js +3 -1
  2. package/dist/cjs/classes/worker.js.map +1 -1
  3. package/dist/cjs/commands/includes/addJobWithPriority.lua +2 -2
  4. package/dist/cjs/commands/includes/getPriorityScore.lua +8 -0
  5. package/dist/cjs/commands/includes/promoteDelayedJobs.lua +7 -3
  6. package/dist/cjs/scripts/addDelayedJob-6.js +8 -2
  7. package/dist/cjs/scripts/addDelayedJob-6.js.map +1 -1
  8. package/dist/cjs/scripts/addParentJob-4.js +8 -2
  9. package/dist/cjs/scripts/addParentJob-4.js.map +1 -1
  10. package/dist/cjs/scripts/addPrioritizedJob-8.js +8 -2
  11. package/dist/cjs/scripts/addPrioritizedJob-8.js.map +1 -1
  12. package/dist/cjs/scripts/addStandardJob-8.js +8 -2
  13. package/dist/cjs/scripts/addStandardJob-8.js.map +1 -1
  14. package/dist/cjs/scripts/changePriority-7.js +8 -2
  15. package/dist/cjs/scripts/changePriority-7.js.map +1 -1
  16. package/dist/cjs/scripts/moveStalledJobsToWait-9.js +8 -2
  17. package/dist/cjs/scripts/moveStalledJobsToWait-9.js.map +1 -1
  18. package/dist/cjs/scripts/moveToActive-11.js +12 -5
  19. package/dist/cjs/scripts/moveToActive-11.js.map +1 -1
  20. package/dist/cjs/scripts/moveToFinished-14.js +12 -5
  21. package/dist/cjs/scripts/moveToFinished-14.js.map +1 -1
  22. package/dist/cjs/scripts/promote-9.js +8 -2
  23. package/dist/cjs/scripts/promote-9.js.map +1 -1
  24. package/dist/cjs/scripts/retryJob-11.js +12 -5
  25. package/dist/cjs/scripts/retryJob-11.js.map +1 -1
  26. package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
  27. package/dist/cjs/version.js +1 -1
  28. package/dist/esm/classes/worker.js +3 -1
  29. package/dist/esm/classes/worker.js.map +1 -1
  30. package/dist/esm/commands/includes/addJobWithPriority.lua +2 -2
  31. package/dist/esm/commands/includes/getPriorityScore.lua +8 -0
  32. package/dist/esm/commands/includes/promoteDelayedJobs.lua +7 -3
  33. package/dist/esm/scripts/addDelayedJob-6.js +8 -2
  34. package/dist/esm/scripts/addDelayedJob-6.js.map +1 -1
  35. package/dist/esm/scripts/addParentJob-4.js +8 -2
  36. package/dist/esm/scripts/addParentJob-4.js.map +1 -1
  37. package/dist/esm/scripts/addPrioritizedJob-8.js +8 -2
  38. package/dist/esm/scripts/addPrioritizedJob-8.js.map +1 -1
  39. package/dist/esm/scripts/addStandardJob-8.js +8 -2
  40. package/dist/esm/scripts/addStandardJob-8.js.map +1 -1
  41. package/dist/esm/scripts/changePriority-7.js +8 -2
  42. package/dist/esm/scripts/changePriority-7.js.map +1 -1
  43. package/dist/esm/scripts/moveStalledJobsToWait-9.js +8 -2
  44. package/dist/esm/scripts/moveStalledJobsToWait-9.js.map +1 -1
  45. package/dist/esm/scripts/moveToActive-11.js +12 -5
  46. package/dist/esm/scripts/moveToActive-11.js.map +1 -1
  47. package/dist/esm/scripts/moveToFinished-14.js +12 -5
  48. package/dist/esm/scripts/moveToFinished-14.js.map +1 -1
  49. package/dist/esm/scripts/promote-9.js +8 -2
  50. package/dist/esm/scripts/promote-9.js.map +1 -1
  51. package/dist/esm/scripts/retryJob-11.js +12 -5
  52. package/dist/esm/scripts/retryJob-11.js.map +1 -1
  53. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  54. package/dist/esm/version.d.ts +1 -1
  55. package/dist/esm/version.js +1 -1
  56. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"addParentJob-4.js","sourceRoot":"","sources":["../../../src/scripts/addParentJob-4.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Uf,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgVf,CAAC;AACF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,cAAc;IACpB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
@@ -60,10 +60,16 @@ local function addBaseMarkerIfNeeded(markerKey, isPausedOrMaxed)
60
60
  rcall("ZADD", markerKey, 0, "0")
61
61
  end
62
62
  end
63
+ --[[
64
+ Function to get priority score.
65
+ ]]
66
+ local function getPriorityScore(priority, priorityCounterKey)
67
+ local prioCounter = rcall("INCR", priorityCounterKey)
68
+ return priority * 0x100000000 + prioCounter % 0x100000000
69
+ end
63
70
  local function addJobWithPriority(markerKey, prioritizedKey, priority, jobId, priorityCounterKey,
64
71
  isPausedOrMaxed)
65
- local prioCounter = rcall("INCR", priorityCounterKey)
66
- local score = priority * 0x100000000 + prioCounter % 0x100000000
72
+ local score = getPriorityScore(priority, priorityCounterKey)
67
73
  rcall("ZADD", prioritizedKey, score, jobId)
68
74
  addBaseMarkerIfNeeded(markerKey, isPausedOrMaxed)
69
75
  end
@@ -1 +1 @@
1
- {"version":3,"file":"addPrioritizedJob-8.js","sourceRoot":"","sources":["../../../src/scripts/addPrioritizedJob-8.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoVf,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Vf,CAAC;AACF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,mBAAmB;IACzB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
@@ -168,10 +168,16 @@ end
168
168
  Function to add job considering priority.
169
169
  ]]
170
170
  -- Includes
171
+ --[[
172
+ Function to get priority score.
173
+ ]]
174
+ local function getPriorityScore(priority, priorityCounterKey)
175
+ local prioCounter = rcall("INCR", priorityCounterKey)
176
+ return priority * 0x100000000 + prioCounter % 0x100000000
177
+ end
171
178
  local function addJobWithPriority(markerKey, prioritizedKey, priority, jobId, priorityCounterKey,
172
179
  isPausedOrMaxed)
173
- local prioCounter = rcall("INCR", priorityCounterKey)
174
- local score = priority * 0x100000000 + prioCounter % 0x100000000
180
+ local score = getPriorityScore(priority, priorityCounterKey)
175
181
  rcall("ZADD", prioritizedKey, score, jobId)
176
182
  addBaseMarkerIfNeeded(markerKey, isPausedOrMaxed)
177
183
  end
@@ -1 +1 @@
1
- {"version":3,"file":"addStandardJob-8.js","sourceRoot":"","sources":["../../../src/scripts/addStandardJob-8.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwVf,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8Vf,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,gBAAgB;IACtB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
@@ -41,10 +41,16 @@ end
41
41
  Function to add job considering priority.
42
42
  ]]
43
43
  -- Includes
44
+ --[[
45
+ Function to get priority score.
46
+ ]]
47
+ local function getPriorityScore(priority, priorityCounterKey)
48
+ local prioCounter = rcall("INCR", priorityCounterKey)
49
+ return priority * 0x100000000 + prioCounter % 0x100000000
50
+ end
44
51
  local function addJobWithPriority(markerKey, prioritizedKey, priority, jobId, priorityCounterKey,
45
52
  isPausedOrMaxed)
46
- local prioCounter = rcall("INCR", priorityCounterKey)
47
- local score = priority * 0x100000000 + prioCounter % 0x100000000
53
+ local score = getPriorityScore(priority, priorityCounterKey)
48
54
  rcall("ZADD", prioritizedKey, score, jobId)
49
55
  addBaseMarkerIfNeeded(markerKey, isPausedOrMaxed)
50
56
  end
@@ -1 +1 @@
1
- {"version":3,"file":"changePriority-7.js","sourceRoot":"","sources":["../../../src/scripts/changePriority-7.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgHf,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,gBAAgB;IACtB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
1
+ {"version":3,"file":"changePriority-7.js","sourceRoot":"","sources":["../../../src/scripts/changePriority-7.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsHf,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,gBAAgB;IACtB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
@@ -107,10 +107,16 @@ end
107
107
  Function to add job considering priority.
108
108
  ]]
109
109
  -- Includes
110
+ --[[
111
+ Function to get priority score.
112
+ ]]
113
+ local function getPriorityScore(priority, priorityCounterKey)
114
+ local prioCounter = rcall("INCR", priorityCounterKey)
115
+ return priority * 0x100000000 + prioCounter % 0x100000000
116
+ end
110
117
  local function addJobWithPriority(markerKey, prioritizedKey, priority, jobId, priorityCounterKey,
111
118
  isPausedOrMaxed)
112
- local prioCounter = rcall("INCR", priorityCounterKey)
113
- local score = priority * 0x100000000 + prioCounter % 0x100000000
119
+ local score = getPriorityScore(priority, priorityCounterKey)
114
120
  rcall("ZADD", prioritizedKey, score, jobId)
115
121
  addBaseMarkerIfNeeded(markerKey, isPausedOrMaxed)
116
122
  end
@@ -1 +1 @@
1
- {"version":3,"file":"moveStalledJobsToWait-9.js","sourceRoot":"","sources":["../../../src/scripts/moveStalledJobsToWait-9.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAugBS,CAAC;AAC1B,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA6gBS,CAAC;AAC1B,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,uBAAuB;IAC7B,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
@@ -159,10 +159,16 @@ end
159
159
  Function to add job considering priority.
160
160
  ]]
161
161
  -- Includes
162
+ --[[
163
+ Function to get priority score.
164
+ ]]
165
+ local function getPriorityScore(priority, priorityCounterKey)
166
+ local prioCounter = rcall("INCR", priorityCounterKey)
167
+ return priority * 0x100000000 + prioCounter % 0x100000000
168
+ end
162
169
  local function addJobWithPriority(markerKey, prioritizedKey, priority, jobId, priorityCounterKey,
163
170
  isPausedOrMaxed)
164
- local prioCounter = rcall("INCR", priorityCounterKey)
165
- local score = priority * 0x100000000 + prioCounter % 0x100000000
171
+ local score = getPriorityScore(priority, priorityCounterKey)
166
172
  rcall("ZADD", prioritizedKey, score, jobId)
167
173
  addBaseMarkerIfNeeded(markerKey, isPausedOrMaxed)
168
174
  end
@@ -178,16 +184,17 @@ local function promoteDelayedJobs(delayedKey, markerKey, targetKey, prioritizedK
178
184
  tonumber(rcall("HGET", jobKey, "priority")) or 0
179
185
  if priority == 0 then
180
186
  -- LIFO or FIFO
181
- addJobInTargetList(targetKey, markerKey, "LPUSH", isPaused, jobId)
187
+ rcall("LPUSH", targetKey, jobId)
182
188
  else
183
- addJobWithPriority(markerKey, prioritizedKey, priority,
184
- jobId, priorityCounterKey, isPaused)
189
+ local score = getPriorityScore(priority, priorityCounterKey)
190
+ rcall("ZADD", prioritizedKey, score, jobId)
185
191
  end
186
192
  -- Emit waiting event
187
193
  rcall("XADD", eventStreamKey, "*", "event", "waiting", "jobId",
188
194
  jobId, "prev", "delayed")
189
195
  rcall("HSET", jobKey, "delay", 0)
190
196
  end
197
+ addBaseMarkerIfNeeded(markerKey, isPaused)
191
198
  end
192
199
  end
193
200
  local target, isPausedOrMaxed = getTargetQueueList(KEYS[9], activeKey, waitKey, KEYS[8])
@@ -1 +1 @@
1
- {"version":3,"file":"moveToActive-11.js","sourceRoot":"","sources":["../../../src/scripts/moveToActive-11.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgOf,CAAC;AACF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,cAAc;IACpB,OAAO;IACP,IAAI,EAAE,EAAE;CACT,CAAC"}
1
+ {"version":3,"file":"moveToActive-11.js","sourceRoot":"","sources":["../../../src/scripts/moveToActive-11.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuOf,CAAC;AACF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,cAAc;IACpB,OAAO;IACP,IAAI,EAAE,EAAE;CACT,CAAC"}
@@ -202,10 +202,16 @@ end
202
202
  Function to add job considering priority.
203
203
  ]]
204
204
  -- Includes
205
+ --[[
206
+ Function to get priority score.
207
+ ]]
208
+ local function getPriorityScore(priority, priorityCounterKey)
209
+ local prioCounter = rcall("INCR", priorityCounterKey)
210
+ return priority * 0x100000000 + prioCounter % 0x100000000
211
+ end
205
212
  local function addJobWithPriority(markerKey, prioritizedKey, priority, jobId, priorityCounterKey,
206
213
  isPausedOrMaxed)
207
- local prioCounter = rcall("INCR", priorityCounterKey)
208
- local score = priority * 0x100000000 + prioCounter % 0x100000000
214
+ local score = getPriorityScore(priority, priorityCounterKey)
209
215
  rcall("ZADD", prioritizedKey, score, jobId)
210
216
  addBaseMarkerIfNeeded(markerKey, isPausedOrMaxed)
211
217
  end
@@ -542,16 +548,17 @@ local function promoteDelayedJobs(delayedKey, markerKey, targetKey, prioritizedK
542
548
  tonumber(rcall("HGET", jobKey, "priority")) or 0
543
549
  if priority == 0 then
544
550
  -- LIFO or FIFO
545
- addJobInTargetList(targetKey, markerKey, "LPUSH", isPaused, jobId)
551
+ rcall("LPUSH", targetKey, jobId)
546
552
  else
547
- addJobWithPriority(markerKey, prioritizedKey, priority,
548
- jobId, priorityCounterKey, isPaused)
553
+ local score = getPriorityScore(priority, priorityCounterKey)
554
+ rcall("ZADD", prioritizedKey, score, jobId)
549
555
  end
550
556
  -- Emit waiting event
551
557
  rcall("XADD", eventStreamKey, "*", "event", "waiting", "jobId",
552
558
  jobId, "prev", "delayed")
553
559
  rcall("HSET", jobKey, "delay", 0)
554
560
  end
561
+ addBaseMarkerIfNeeded(markerKey, isPaused)
555
562
  end
556
563
  end
557
564
  local function removeLock(jobKey, stalledKey, token, jobId)
@@ -1 +1 @@
1
- {"version":3,"file":"moveToFinished-14.js","sourceRoot":"","sources":["../../../src/scripts/moveToFinished-14.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqxBf,CAAC;AACF,MAAM,CAAC,MAAM,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4xBf,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,gBAAgB;IACtB,OAAO;IACP,IAAI,EAAE,EAAE;CACT,CAAC"}
@@ -41,10 +41,16 @@ end
41
41
  Function to add job considering priority.
42
42
  ]]
43
43
  -- Includes
44
+ --[[
45
+ Function to get priority score.
46
+ ]]
47
+ local function getPriorityScore(priority, priorityCounterKey)
48
+ local prioCounter = rcall("INCR", priorityCounterKey)
49
+ return priority * 0x100000000 + prioCounter % 0x100000000
50
+ end
44
51
  local function addJobWithPriority(markerKey, prioritizedKey, priority, jobId, priorityCounterKey,
45
52
  isPausedOrMaxed)
46
- local prioCounter = rcall("INCR", priorityCounterKey)
47
- local score = priority * 0x100000000 + prioCounter % 0x100000000
53
+ local score = getPriorityScore(priority, priorityCounterKey)
48
54
  rcall("ZADD", prioritizedKey, score, jobId)
49
55
  addBaseMarkerIfNeeded(markerKey, isPausedOrMaxed)
50
56
  end
@@ -1 +1 @@
1
- {"version":3,"file":"promote-9.js","sourceRoot":"","sources":["../../../src/scripts/promote-9.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+Ff,CAAC;AACF,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,IAAI,EAAE,SAAS;IACf,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
1
+ {"version":3,"file":"promote-9.js","sourceRoot":"","sources":["../../../src/scripts/promote-9.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqGf,CAAC;AACF,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,IAAI,EAAE,SAAS;IACf,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
@@ -48,10 +48,16 @@ end
48
48
  Function to add job considering priority.
49
49
  ]]
50
50
  -- Includes
51
+ --[[
52
+ Function to get priority score.
53
+ ]]
54
+ local function getPriorityScore(priority, priorityCounterKey)
55
+ local prioCounter = rcall("INCR", priorityCounterKey)
56
+ return priority * 0x100000000 + prioCounter % 0x100000000
57
+ end
51
58
  local function addJobWithPriority(markerKey, prioritizedKey, priority, jobId, priorityCounterKey,
52
59
  isPausedOrMaxed)
53
- local prioCounter = rcall("INCR", priorityCounterKey)
54
- local score = priority * 0x100000000 + prioCounter % 0x100000000
60
+ local score = getPriorityScore(priority, priorityCounterKey)
55
61
  rcall("ZADD", prioritizedKey, score, jobId)
56
62
  addBaseMarkerIfNeeded(markerKey, isPausedOrMaxed)
57
63
  end
@@ -121,16 +127,17 @@ local function promoteDelayedJobs(delayedKey, markerKey, targetKey, prioritizedK
121
127
  tonumber(rcall("HGET", jobKey, "priority")) or 0
122
128
  if priority == 0 then
123
129
  -- LIFO or FIFO
124
- addJobInTargetList(targetKey, markerKey, "LPUSH", isPaused, jobId)
130
+ rcall("LPUSH", targetKey, jobId)
125
131
  else
126
- addJobWithPriority(markerKey, prioritizedKey, priority,
127
- jobId, priorityCounterKey, isPaused)
132
+ local score = getPriorityScore(priority, priorityCounterKey)
133
+ rcall("ZADD", prioritizedKey, score, jobId)
128
134
  end
129
135
  -- Emit waiting event
130
136
  rcall("XADD", eventStreamKey, "*", "event", "waiting", "jobId",
131
137
  jobId, "prev", "delayed")
132
138
  rcall("HSET", jobKey, "delay", 0)
133
139
  end
140
+ addBaseMarkerIfNeeded(markerKey, isPaused)
134
141
  end
135
142
  end
136
143
  local function removeLock(jobKey, stalledKey, token, jobId)
@@ -1 +1 @@
1
- {"version":3,"file":"retryJob-11.js","sourceRoot":"","sources":["../../../src/scripts/retryJob-11.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqMf,CAAC;AACF,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,UAAU;IAChB,OAAO;IACP,IAAI,EAAE,EAAE;CACT,CAAC"}
1
+ {"version":3,"file":"retryJob-11.js","sourceRoot":"","sources":["../../../src/scripts/retryJob-11.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4Mf,CAAC;AACF,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,UAAU;IAChB,OAAO;IACP,IAAI,EAAE,EAAE;CACT,CAAC"}