bullmq 5.41.3 → 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 (52) hide show
  1. package/dist/cjs/commands/includes/addJobWithPriority.lua +2 -2
  2. package/dist/cjs/commands/includes/getPriorityScore.lua +8 -0
  3. package/dist/cjs/commands/includes/promoteDelayedJobs.lua +7 -3
  4. package/dist/cjs/scripts/addDelayedJob-6.js +8 -2
  5. package/dist/cjs/scripts/addDelayedJob-6.js.map +1 -1
  6. package/dist/cjs/scripts/addParentJob-4.js +8 -2
  7. package/dist/cjs/scripts/addParentJob-4.js.map +1 -1
  8. package/dist/cjs/scripts/addPrioritizedJob-8.js +8 -2
  9. package/dist/cjs/scripts/addPrioritizedJob-8.js.map +1 -1
  10. package/dist/cjs/scripts/addStandardJob-8.js +8 -2
  11. package/dist/cjs/scripts/addStandardJob-8.js.map +1 -1
  12. package/dist/cjs/scripts/changePriority-7.js +8 -2
  13. package/dist/cjs/scripts/changePriority-7.js.map +1 -1
  14. package/dist/cjs/scripts/moveStalledJobsToWait-9.js +8 -2
  15. package/dist/cjs/scripts/moveStalledJobsToWait-9.js.map +1 -1
  16. package/dist/cjs/scripts/moveToActive-11.js +12 -5
  17. package/dist/cjs/scripts/moveToActive-11.js.map +1 -1
  18. package/dist/cjs/scripts/moveToFinished-14.js +12 -5
  19. package/dist/cjs/scripts/moveToFinished-14.js.map +1 -1
  20. package/dist/cjs/scripts/promote-9.js +8 -2
  21. package/dist/cjs/scripts/promote-9.js.map +1 -1
  22. package/dist/cjs/scripts/retryJob-11.js +12 -5
  23. package/dist/cjs/scripts/retryJob-11.js.map +1 -1
  24. package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
  25. package/dist/cjs/version.js +1 -1
  26. package/dist/esm/commands/includes/addJobWithPriority.lua +2 -2
  27. package/dist/esm/commands/includes/getPriorityScore.lua +8 -0
  28. package/dist/esm/commands/includes/promoteDelayedJobs.lua +7 -3
  29. package/dist/esm/scripts/addDelayedJob-6.js +8 -2
  30. package/dist/esm/scripts/addDelayedJob-6.js.map +1 -1
  31. package/dist/esm/scripts/addParentJob-4.js +8 -2
  32. package/dist/esm/scripts/addParentJob-4.js.map +1 -1
  33. package/dist/esm/scripts/addPrioritizedJob-8.js +8 -2
  34. package/dist/esm/scripts/addPrioritizedJob-8.js.map +1 -1
  35. package/dist/esm/scripts/addStandardJob-8.js +8 -2
  36. package/dist/esm/scripts/addStandardJob-8.js.map +1 -1
  37. package/dist/esm/scripts/changePriority-7.js +8 -2
  38. package/dist/esm/scripts/changePriority-7.js.map +1 -1
  39. package/dist/esm/scripts/moveStalledJobsToWait-9.js +8 -2
  40. package/dist/esm/scripts/moveStalledJobsToWait-9.js.map +1 -1
  41. package/dist/esm/scripts/moveToActive-11.js +12 -5
  42. package/dist/esm/scripts/moveToActive-11.js.map +1 -1
  43. package/dist/esm/scripts/moveToFinished-14.js +12 -5
  44. package/dist/esm/scripts/moveToFinished-14.js.map +1 -1
  45. package/dist/esm/scripts/promote-9.js +8 -2
  46. package/dist/esm/scripts/promote-9.js.map +1 -1
  47. package/dist/esm/scripts/retryJob-11.js +12 -5
  48. package/dist/esm/scripts/retryJob-11.js.map +1 -1
  49. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  50. package/dist/esm/version.d.ts +1 -1
  51. package/dist/esm/version.js +1 -1
  52. package/package.json +1 -1
@@ -4,11 +4,11 @@
4
4
 
5
5
  -- Includes
6
6
  --- @include "addBaseMarkerIfNeeded"
7
+ --- @include "getPriorityScore"
7
8
 
8
9
  local function addJobWithPriority(markerKey, prioritizedKey, priority, jobId, priorityCounterKey,
9
10
  isPausedOrMaxed)
10
- local prioCounter = rcall("INCR", priorityCounterKey)
11
- local score = priority * 0x100000000 + prioCounter % 0x100000000
11
+ local score = getPriorityScore(priority, priorityCounterKey)
12
12
  rcall("ZADD", prioritizedKey, score, jobId)
13
13
  addBaseMarkerIfNeeded(markerKey, isPausedOrMaxed)
14
14
  end
@@ -0,0 +1,8 @@
1
+ --[[
2
+ Function to get priority score.
3
+ ]]
4
+
5
+ local function getPriorityScore(priority, priorityCounterKey)
6
+ local prioCounter = rcall("INCR", priorityCounterKey)
7
+ return priority * 0x100000000 + prioCounter % 0x100000000
8
+ end
@@ -7,8 +7,10 @@
7
7
  ]]
8
8
 
9
9
  -- Includes
10
+ --- @include "addBaseMarkerIfNeeded"
10
11
  --- @include "addJobInTargetList"
11
12
  --- @include "addJobWithPriority"
13
+ --- @include "getPriorityScore"
12
14
 
13
15
  -- Try to get as much as 1000 jobs at once
14
16
  local function promoteDelayedJobs(delayedKey, markerKey, targetKey, prioritizedKey,
@@ -25,10 +27,10 @@ local function promoteDelayedJobs(delayedKey, markerKey, targetKey, prioritizedK
25
27
 
26
28
  if priority == 0 then
27
29
  -- LIFO or FIFO
28
- addJobInTargetList(targetKey, markerKey, "LPUSH", isPaused, jobId)
30
+ rcall("LPUSH", targetKey, jobId)
29
31
  else
30
- addJobWithPriority(markerKey, prioritizedKey, priority,
31
- jobId, priorityCounterKey, isPaused)
32
+ local score = getPriorityScore(priority, priorityCounterKey)
33
+ rcall("ZADD", prioritizedKey, score, jobId)
32
34
  end
33
35
 
34
36
  -- Emit waiting event
@@ -36,5 +38,7 @@ local function promoteDelayedJobs(delayedKey, markerKey, targetKey, prioritizedK
36
38
  jobId, "prev", "delayed")
37
39
  rcall("HSET", jobKey, "delay", 0)
38
40
  end
41
+
42
+ addBaseMarkerIfNeeded(markerKey, isPaused)
39
43
  end
40
44
  end
@@ -218,10 +218,16 @@ end
218
218
  Function to add job considering priority.
219
219
  ]]
220
220
  -- Includes
221
+ --[[
222
+ Function to get priority score.
223
+ ]]
224
+ local function getPriorityScore(priority, priorityCounterKey)
225
+ local prioCounter = rcall("INCR", priorityCounterKey)
226
+ return priority * 0x100000000 + prioCounter % 0x100000000
227
+ end
221
228
  local function addJobWithPriority(markerKey, prioritizedKey, priority, jobId, priorityCounterKey,
222
229
  isPausedOrMaxed)
223
- local prioCounter = rcall("INCR", priorityCounterKey)
224
- local score = priority * 0x100000000 + prioCounter % 0x100000000
230
+ local score = getPriorityScore(priority, priorityCounterKey)
225
231
  rcall("ZADD", prioritizedKey, score, jobId)
226
232
  addBaseMarkerIfNeeded(markerKey, isPausedOrMaxed)
227
233
  end
@@ -1 +1 @@
1
- {"version":3,"file":"addDelayedJob-6.js","sourceRoot":"","sources":["../../../src/scripts/addDelayedJob-6.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqXf,CAAC;AACW,QAAA,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2Xf,CAAC;AACW,QAAA,aAAa,GAAG;IAC3B,IAAI,EAAE,eAAe;IACrB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
@@ -141,10 +141,16 @@ end
141
141
  Function to add job considering priority.
142
142
  ]]
143
143
  -- Includes
144
+ --[[
145
+ Function to get priority score.
146
+ ]]
147
+ local function getPriorityScore(priority, priorityCounterKey)
148
+ local prioCounter = rcall("INCR", priorityCounterKey)
149
+ return priority * 0x100000000 + prioCounter % 0x100000000
150
+ end
144
151
  local function addJobWithPriority(markerKey, prioritizedKey, priority, jobId, priorityCounterKey,
145
152
  isPausedOrMaxed)
146
- local prioCounter = rcall("INCR", priorityCounterKey)
147
- local score = priority * 0x100000000 + prioCounter % 0x100000000
153
+ local score = getPriorityScore(priority, priorityCounterKey)
148
154
  rcall("ZADD", prioritizedKey, score, jobId)
149
155
  addBaseMarkerIfNeeded(markerKey, isPausedOrMaxed)
150
156
  end
@@ -1 +1 @@
1
- {"version":3,"file":"addParentJob-4.js","sourceRoot":"","sources":["../../../src/scripts/addParentJob-4.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Uf,CAAC;AACW,QAAA,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;AACW,QAAA,YAAY,GAAG;IAC1B,IAAI,EAAE,cAAc;IACpB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
@@ -63,10 +63,16 @@ local function addBaseMarkerIfNeeded(markerKey, isPausedOrMaxed)
63
63
  rcall("ZADD", markerKey, 0, "0")
64
64
  end
65
65
  end
66
+ --[[
67
+ Function to get priority score.
68
+ ]]
69
+ local function getPriorityScore(priority, priorityCounterKey)
70
+ local prioCounter = rcall("INCR", priorityCounterKey)
71
+ return priority * 0x100000000 + prioCounter % 0x100000000
72
+ end
66
73
  local function addJobWithPriority(markerKey, prioritizedKey, priority, jobId, priorityCounterKey,
67
74
  isPausedOrMaxed)
68
- local prioCounter = rcall("INCR", priorityCounterKey)
69
- local score = priority * 0x100000000 + prioCounter % 0x100000000
75
+ local score = getPriorityScore(priority, priorityCounterKey)
70
76
  rcall("ZADD", prioritizedKey, score, jobId)
71
77
  addBaseMarkerIfNeeded(markerKey, isPausedOrMaxed)
72
78
  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;AACW,QAAA,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;AACW,QAAA,iBAAiB,GAAG;IAC/B,IAAI,EAAE,mBAAmB;IACzB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
@@ -171,10 +171,16 @@ end
171
171
  Function to add job considering priority.
172
172
  ]]
173
173
  -- Includes
174
+ --[[
175
+ Function to get priority score.
176
+ ]]
177
+ local function getPriorityScore(priority, priorityCounterKey)
178
+ local prioCounter = rcall("INCR", priorityCounterKey)
179
+ return priority * 0x100000000 + prioCounter % 0x100000000
180
+ end
174
181
  local function addJobWithPriority(markerKey, prioritizedKey, priority, jobId, priorityCounterKey,
175
182
  isPausedOrMaxed)
176
- local prioCounter = rcall("INCR", priorityCounterKey)
177
- local score = priority * 0x100000000 + prioCounter % 0x100000000
183
+ local score = getPriorityScore(priority, priorityCounterKey)
178
184
  rcall("ZADD", prioritizedKey, score, jobId)
179
185
  addBaseMarkerIfNeeded(markerKey, isPausedOrMaxed)
180
186
  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;AACW,QAAA,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;AACW,QAAA,cAAc,GAAG;IAC5B,IAAI,EAAE,gBAAgB;IACtB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
@@ -44,10 +44,16 @@ end
44
44
  Function to add job considering priority.
45
45
  ]]
46
46
  -- Includes
47
+ --[[
48
+ Function to get priority score.
49
+ ]]
50
+ local function getPriorityScore(priority, priorityCounterKey)
51
+ local prioCounter = rcall("INCR", priorityCounterKey)
52
+ return priority * 0x100000000 + prioCounter % 0x100000000
53
+ end
47
54
  local function addJobWithPriority(markerKey, prioritizedKey, priority, jobId, priorityCounterKey,
48
55
  isPausedOrMaxed)
49
- local prioCounter = rcall("INCR", priorityCounterKey)
50
- local score = priority * 0x100000000 + prioCounter % 0x100000000
56
+ local score = getPriorityScore(priority, priorityCounterKey)
51
57
  rcall("ZADD", prioritizedKey, score, jobId)
52
58
  addBaseMarkerIfNeeded(markerKey, isPausedOrMaxed)
53
59
  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;AACW,QAAA,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;AACW,QAAA,cAAc,GAAG;IAC5B,IAAI,EAAE,gBAAgB;IACtB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
@@ -110,10 +110,16 @@ end
110
110
  Function to add job considering priority.
111
111
  ]]
112
112
  -- Includes
113
+ --[[
114
+ Function to get priority score.
115
+ ]]
116
+ local function getPriorityScore(priority, priorityCounterKey)
117
+ local prioCounter = rcall("INCR", priorityCounterKey)
118
+ return priority * 0x100000000 + prioCounter % 0x100000000
119
+ end
113
120
  local function addJobWithPriority(markerKey, prioritizedKey, priority, jobId, priorityCounterKey,
114
121
  isPausedOrMaxed)
115
- local prioCounter = rcall("INCR", priorityCounterKey)
116
- local score = priority * 0x100000000 + prioCounter % 0x100000000
122
+ local score = getPriorityScore(priority, priorityCounterKey)
117
123
  rcall("ZADD", prioritizedKey, score, jobId)
118
124
  addBaseMarkerIfNeeded(markerKey, isPausedOrMaxed)
119
125
  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;AACb,QAAA,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;AACb,QAAA,qBAAqB,GAAG;IACnC,IAAI,EAAE,uBAAuB;IAC7B,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
@@ -162,10 +162,16 @@ end
162
162
  Function to add job considering priority.
163
163
  ]]
164
164
  -- Includes
165
+ --[[
166
+ Function to get priority score.
167
+ ]]
168
+ local function getPriorityScore(priority, priorityCounterKey)
169
+ local prioCounter = rcall("INCR", priorityCounterKey)
170
+ return priority * 0x100000000 + prioCounter % 0x100000000
171
+ end
165
172
  local function addJobWithPriority(markerKey, prioritizedKey, priority, jobId, priorityCounterKey,
166
173
  isPausedOrMaxed)
167
- local prioCounter = rcall("INCR", priorityCounterKey)
168
- local score = priority * 0x100000000 + prioCounter % 0x100000000
174
+ local score = getPriorityScore(priority, priorityCounterKey)
169
175
  rcall("ZADD", prioritizedKey, score, jobId)
170
176
  addBaseMarkerIfNeeded(markerKey, isPausedOrMaxed)
171
177
  end
@@ -181,16 +187,17 @@ local function promoteDelayedJobs(delayedKey, markerKey, targetKey, prioritizedK
181
187
  tonumber(rcall("HGET", jobKey, "priority")) or 0
182
188
  if priority == 0 then
183
189
  -- LIFO or FIFO
184
- addJobInTargetList(targetKey, markerKey, "LPUSH", isPaused, jobId)
190
+ rcall("LPUSH", targetKey, jobId)
185
191
  else
186
- addJobWithPriority(markerKey, prioritizedKey, priority,
187
- jobId, priorityCounterKey, isPaused)
192
+ local score = getPriorityScore(priority, priorityCounterKey)
193
+ rcall("ZADD", prioritizedKey, score, jobId)
188
194
  end
189
195
  -- Emit waiting event
190
196
  rcall("XADD", eventStreamKey, "*", "event", "waiting", "jobId",
191
197
  jobId, "prev", "delayed")
192
198
  rcall("HSET", jobKey, "delay", 0)
193
199
  end
200
+ addBaseMarkerIfNeeded(markerKey, isPaused)
194
201
  end
195
202
  end
196
203
  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;AACW,QAAA,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;AACW,QAAA,YAAY,GAAG;IAC1B,IAAI,EAAE,cAAc;IACpB,OAAO;IACP,IAAI,EAAE,EAAE;CACT,CAAC"}
@@ -205,10 +205,16 @@ end
205
205
  Function to add job considering priority.
206
206
  ]]
207
207
  -- Includes
208
+ --[[
209
+ Function to get priority score.
210
+ ]]
211
+ local function getPriorityScore(priority, priorityCounterKey)
212
+ local prioCounter = rcall("INCR", priorityCounterKey)
213
+ return priority * 0x100000000 + prioCounter % 0x100000000
214
+ end
208
215
  local function addJobWithPriority(markerKey, prioritizedKey, priority, jobId, priorityCounterKey,
209
216
  isPausedOrMaxed)
210
- local prioCounter = rcall("INCR", priorityCounterKey)
211
- local score = priority * 0x100000000 + prioCounter % 0x100000000
217
+ local score = getPriorityScore(priority, priorityCounterKey)
212
218
  rcall("ZADD", prioritizedKey, score, jobId)
213
219
  addBaseMarkerIfNeeded(markerKey, isPausedOrMaxed)
214
220
  end
@@ -545,16 +551,17 @@ local function promoteDelayedJobs(delayedKey, markerKey, targetKey, prioritizedK
545
551
  tonumber(rcall("HGET", jobKey, "priority")) or 0
546
552
  if priority == 0 then
547
553
  -- LIFO or FIFO
548
- addJobInTargetList(targetKey, markerKey, "LPUSH", isPaused, jobId)
554
+ rcall("LPUSH", targetKey, jobId)
549
555
  else
550
- addJobWithPriority(markerKey, prioritizedKey, priority,
551
- jobId, priorityCounterKey, isPaused)
556
+ local score = getPriorityScore(priority, priorityCounterKey)
557
+ rcall("ZADD", prioritizedKey, score, jobId)
552
558
  end
553
559
  -- Emit waiting event
554
560
  rcall("XADD", eventStreamKey, "*", "event", "waiting", "jobId",
555
561
  jobId, "prev", "delayed")
556
562
  rcall("HSET", jobKey, "delay", 0)
557
563
  end
564
+ addBaseMarkerIfNeeded(markerKey, isPaused)
558
565
  end
559
566
  end
560
567
  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;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4xBf,CAAC;AACW,QAAA,cAAc,GAAG;IAC5B,IAAI,EAAE,gBAAgB;IACtB,OAAO;IACP,IAAI,EAAE,EAAE;CACT,CAAC"}
@@ -44,10 +44,16 @@ end
44
44
  Function to add job considering priority.
45
45
  ]]
46
46
  -- Includes
47
+ --[[
48
+ Function to get priority score.
49
+ ]]
50
+ local function getPriorityScore(priority, priorityCounterKey)
51
+ local prioCounter = rcall("INCR", priorityCounterKey)
52
+ return priority * 0x100000000 + prioCounter % 0x100000000
53
+ end
47
54
  local function addJobWithPriority(markerKey, prioritizedKey, priority, jobId, priorityCounterKey,
48
55
  isPausedOrMaxed)
49
- local prioCounter = rcall("INCR", priorityCounterKey)
50
- local score = priority * 0x100000000 + prioCounter % 0x100000000
56
+ local score = getPriorityScore(priority, priorityCounterKey)
51
57
  rcall("ZADD", prioritizedKey, score, jobId)
52
58
  addBaseMarkerIfNeeded(markerKey, isPausedOrMaxed)
53
59
  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;AACW,QAAA,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;AACW,QAAA,OAAO,GAAG;IACrB,IAAI,EAAE,SAAS;IACf,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
@@ -51,10 +51,16 @@ end
51
51
  Function to add job considering priority.
52
52
  ]]
53
53
  -- Includes
54
+ --[[
55
+ Function to get priority score.
56
+ ]]
57
+ local function getPriorityScore(priority, priorityCounterKey)
58
+ local prioCounter = rcall("INCR", priorityCounterKey)
59
+ return priority * 0x100000000 + prioCounter % 0x100000000
60
+ end
54
61
  local function addJobWithPriority(markerKey, prioritizedKey, priority, jobId, priorityCounterKey,
55
62
  isPausedOrMaxed)
56
- local prioCounter = rcall("INCR", priorityCounterKey)
57
- local score = priority * 0x100000000 + prioCounter % 0x100000000
63
+ local score = getPriorityScore(priority, priorityCounterKey)
58
64
  rcall("ZADD", prioritizedKey, score, jobId)
59
65
  addBaseMarkerIfNeeded(markerKey, isPausedOrMaxed)
60
66
  end
@@ -124,16 +130,17 @@ local function promoteDelayedJobs(delayedKey, markerKey, targetKey, prioritizedK
124
130
  tonumber(rcall("HGET", jobKey, "priority")) or 0
125
131
  if priority == 0 then
126
132
  -- LIFO or FIFO
127
- addJobInTargetList(targetKey, markerKey, "LPUSH", isPaused, jobId)
133
+ rcall("LPUSH", targetKey, jobId)
128
134
  else
129
- addJobWithPriority(markerKey, prioritizedKey, priority,
130
- jobId, priorityCounterKey, isPaused)
135
+ local score = getPriorityScore(priority, priorityCounterKey)
136
+ rcall("ZADD", prioritizedKey, score, jobId)
131
137
  end
132
138
  -- Emit waiting event
133
139
  rcall("XADD", eventStreamKey, "*", "event", "waiting", "jobId",
134
140
  jobId, "prev", "delayed")
135
141
  rcall("HSET", jobKey, "delay", 0)
136
142
  end
143
+ addBaseMarkerIfNeeded(markerKey, isPaused)
137
144
  end
138
145
  end
139
146
  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;AACW,QAAA,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;AACW,QAAA,QAAQ,GAAG;IACtB,IAAI,EAAE,UAAU;IAChB,OAAO;IACP,IAAI,EAAE,EAAE;CACT,CAAC"}