bullmq 3.14.2 → 3.15.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 (65) hide show
  1. package/dist/cjs/classes/job.js +8 -0
  2. package/dist/cjs/classes/job.js.map +1 -1
  3. package/dist/cjs/classes/scripts.js +22 -0
  4. package/dist/cjs/classes/scripts.js.map +1 -1
  5. package/dist/cjs/commands/changePriority-4.lua +50 -0
  6. package/dist/cjs/commands/includes/getRateLimitTTL.lua +10 -6
  7. package/dist/cjs/commands/includes/getTargetQueueList.lua +2 -2
  8. package/dist/cjs/commands/includes/moveJobFromWaitToActive.lua +7 -15
  9. package/dist/cjs/commands/moveToActive-9.lua +13 -7
  10. package/dist/cjs/commands/moveToFinished-12.lua +6 -5
  11. package/dist/cjs/scripts/addJob-8.js +2 -2
  12. package/dist/cjs/scripts/changePriority-4.js +75 -0
  13. package/dist/cjs/scripts/changePriority-4.js.map +1 -0
  14. package/dist/cjs/scripts/cleanJobsInSet-2.js +2 -2
  15. package/dist/cjs/scripts/drain-4.js +2 -2
  16. package/dist/cjs/scripts/index.js +1 -0
  17. package/dist/cjs/scripts/index.js.map +1 -1
  18. package/dist/cjs/scripts/moveJobFromActiveToWait-9.js +2 -2
  19. package/dist/cjs/scripts/moveStalledJobsToWait-8.js +2 -2
  20. package/dist/cjs/scripts/moveToActive-9.js +27 -27
  21. package/dist/cjs/scripts/moveToDelayed-8.js +2 -2
  22. package/dist/cjs/scripts/moveToFinished-12.js +22 -25
  23. package/dist/cjs/scripts/moveToFinished-12.js.map +1 -1
  24. package/dist/cjs/scripts/obliterate-2.js +2 -2
  25. package/dist/cjs/scripts/promote-6.js +2 -2
  26. package/dist/cjs/scripts/removeJob-1.js +2 -2
  27. package/dist/cjs/scripts/reprocessJob-6.js +2 -2
  28. package/dist/cjs/scripts/retryJob-8.js +2 -2
  29. package/dist/cjs/scripts/retryJobs-6.js +2 -2
  30. package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
  31. package/dist/esm/classes/job.d.ts +10 -1
  32. package/dist/esm/classes/job.js +8 -0
  33. package/dist/esm/classes/job.js.map +1 -1
  34. package/dist/esm/classes/scripts.d.ts +2 -0
  35. package/dist/esm/classes/scripts.js +22 -0
  36. package/dist/esm/classes/scripts.js.map +1 -1
  37. package/dist/esm/commands/changePriority-4.lua +50 -0
  38. package/dist/esm/commands/includes/getRateLimitTTL.lua +10 -6
  39. package/dist/esm/commands/includes/getTargetQueueList.lua +2 -2
  40. package/dist/esm/commands/includes/moveJobFromWaitToActive.lua +7 -15
  41. package/dist/esm/commands/moveToActive-9.lua +13 -7
  42. package/dist/esm/commands/moveToFinished-12.lua +6 -5
  43. package/dist/esm/scripts/addJob-8.js +2 -2
  44. package/dist/esm/scripts/changePriority-4.d.ts +5 -0
  45. package/dist/esm/scripts/changePriority-4.js +72 -0
  46. package/dist/esm/scripts/changePriority-4.js.map +1 -0
  47. package/dist/esm/scripts/cleanJobsInSet-2.js +2 -2
  48. package/dist/esm/scripts/drain-4.js +2 -2
  49. package/dist/esm/scripts/index.d.ts +1 -0
  50. package/dist/esm/scripts/index.js +1 -0
  51. package/dist/esm/scripts/index.js.map +1 -1
  52. package/dist/esm/scripts/moveJobFromActiveToWait-9.js +2 -2
  53. package/dist/esm/scripts/moveStalledJobsToWait-8.js +2 -2
  54. package/dist/esm/scripts/moveToActive-9.js +27 -27
  55. package/dist/esm/scripts/moveToDelayed-8.js +2 -2
  56. package/dist/esm/scripts/moveToFinished-12.js +22 -25
  57. package/dist/esm/scripts/moveToFinished-12.js.map +1 -1
  58. package/dist/esm/scripts/obliterate-2.js +2 -2
  59. package/dist/esm/scripts/promote-6.js +2 -2
  60. package/dist/esm/scripts/removeJob-1.js +2 -2
  61. package/dist/esm/scripts/reprocessJob-6.js +2 -2
  62. package/dist/esm/scripts/retryJob-8.js +2 -2
  63. package/dist/esm/scripts/retryJobs-6.js +2 -2
  64. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  65. package/package.json +1 -1
@@ -57,9 +57,9 @@ end
57
57
  ]]
58
58
  local function getTargetQueueList(queueMetaKey, waitKey, pausedKey)
59
59
  if rcall("HEXISTS", queueMetaKey, "paused") ~= 1 then
60
- return waitKey
60
+ return waitKey, false
61
61
  else
62
- return pausedKey
62
+ return pausedKey, true
63
63
  end
64
64
  end
65
65
  --[[
@@ -43,16 +43,11 @@ local rcall = redis.call
43
43
  opts - lockDuration
44
44
  opts - limiter
45
45
  ]]
46
- local function moveJobFromWaitToActive(keys, keyPrefix, jobId, processedOn, opts)
46
+ local function moveJobFromWaitToActive(keys, keyPrefix, targetKey, jobId, processedOn,
47
+ maxJobs, expireTime, opts)
47
48
  -- Check if we need to perform rate limiting.
48
- local maxJobs = tonumber(opts['limiter'] and opts['limiter']['max'])
49
- local expireTime
50
- if(maxJobs) then
49
+ if maxJobs then
51
50
  local rateLimiterKey = keys[6];
52
- expireTime = tonumber(rcall("PTTL", rateLimiterKey))
53
- if expireTime <= 0 then
54
- rcall("DEL", rateLimiterKey)
55
- end
56
51
  local jobCounter = tonumber(rcall("INCR", rateLimiterKey))
57
52
  if jobCounter == 1 then
58
53
  local limiterDuration = opts['limiter'] and opts['limiter']['duration']
@@ -60,12 +55,12 @@ local function moveJobFromWaitToActive(keys, keyPrefix, jobId, processedOn, opts
60
55
  rcall("PEXPIRE", rateLimiterKey, integerDuration)
61
56
  end
62
57
  -- check if we passed rate limit, we need to remove the job and return expireTime
63
- if jobCounter > maxJobs then
58
+ if expireTime > 0 then
64
59
  -- remove from active queue and add back to the wait list
65
60
  rcall("LREM", keys[2], 1, jobId)
66
- rcall("RPUSH", keys[1], jobId)
61
+ rcall("RPUSH", targetKey, jobId)
67
62
  -- Return when we can process more jobs
68
- return {0, 0, expireTime}
63
+ return {0, 0, expireTime, 0}
69
64
  end
70
65
  end
71
66
  local jobKey = keyPrefix .. jobId
@@ -78,7 +73,7 @@ local function moveJobFromWaitToActive(keys, keyPrefix, jobId, processedOn, opts
78
73
  rcall("XADD", keys[4], "*", "event", "active", "jobId", jobId, "prev", "waiting")
79
74
  rcall("HSET", jobKey, "processedOn", processedOn)
80
75
  rcall("HINCRBY", jobKey, "attemptsMade", 1)
81
- return {rcall("HGETALL", jobKey), jobId, expireTime} -- get job data
76
+ return {rcall("HGETALL", jobKey), jobId, 0, 0} -- get job data
82
77
  end
83
78
  --[[
84
79
  Function to return the next delayed job timestamp.
@@ -93,13 +88,15 @@ local function getNextDelayedTimestamp(delayedKey)
93
88
  return nextTimestamp
94
89
  end
95
90
  end
96
- local function getRateLimitTTL(opts, limiterKey)
97
- local maxJobs = tonumber(opts['limiter'] and opts['limiter']['max'])
91
+ local function getRateLimitTTL(maxJobs, rateLimiterKey)
98
92
  if maxJobs then
99
- local jobCounter = tonumber(rcall("GET", limiterKey))
100
- if jobCounter ~= nil and jobCounter >= maxJobs then
101
- local pttl = rcall("PTTL", limiterKey)
102
- if pttl > 0 then
93
+ local pttl = rcall("PTTL", rateLimiterKey)
94
+ if pttl <= 0 then
95
+ rcall("DEL", rateLimiterKey)
96
+ end
97
+ local jobCounter = tonumber(rcall("GET", rateLimiterKey) or 0)
98
+ if jobCounter >= maxJobs then
99
+ if pttl > 0 then
103
100
  return pttl
104
101
  end
105
102
  end
@@ -112,9 +109,9 @@ end
112
109
  ]]
113
110
  local function getTargetQueueList(queueMetaKey, waitKey, pausedKey)
114
111
  if rcall("HEXISTS", queueMetaKey, "paused") ~= 1 then
115
- return waitKey
112
+ return waitKey, false
116
113
  else
117
- return pausedKey
114
+ return pausedKey, true
118
115
  end
119
116
  end
120
117
  --[[
@@ -163,17 +160,17 @@ end
163
160
  local target = getTargetQueueList(KEYS[9], KEYS[1], KEYS[8])
164
161
  -- Check if there are delayed jobs that we can move to wait.
165
162
  promoteDelayedJobs(KEYS[7], target, KEYS[3], KEYS[4], ARGV[1], ARGV[2])
166
- local opts
163
+ local opts = cmsgpack.unpack(ARGV[4])
164
+ local maxJobs = tonumber(opts['limiter'] and opts['limiter']['max'])
165
+ local expireTime = getRateLimitTTL(maxJobs, KEYS[6])
167
166
  if (ARGV[3] ~= "") then
168
167
  jobId = ARGV[3]
169
168
  -- clean stalled key
170
169
  rcall("SREM", KEYS[5], jobId)
171
170
  else
172
171
  -- Check if we are rate limited first.
173
- opts = cmsgpack.unpack(ARGV[4])
174
- local pttl = getRateLimitTTL(opts, KEYS[6])
175
- if pttl > 0 then
176
- return { 0, 0, pttl }
172
+ if expireTime > 0 then
173
+ return { 0, 0, expireTime, 0 }
177
174
  end
178
175
  -- no job ID, try non-blocking move from wait to active
179
176
  jobId = rcall("RPOPLPUSH", KEYS[1], KEYS[2])
@@ -182,6 +179,9 @@ end
182
179
  if jobId then
183
180
  if string.sub(jobId, 1, 2) == "0:" then
184
181
  rcall("LREM", KEYS[2], 1, jobId)
182
+ if expireTime > 0 then
183
+ return { 0, 0, expireTime, 0 }
184
+ end
185
185
  -- Move again since we just got the marker job.
186
186
  jobId = rcall("RPOPLPUSH", KEYS[1], KEYS[2])
187
187
  -- Since it is possible that between a call to BRPOPLPUSH and moveToActive
@@ -192,9 +192,8 @@ if jobId then
192
192
  end
193
193
  end
194
194
  if jobId then
195
- opts = opts or cmsgpack.unpack(ARGV[4])
196
195
  -- this script is not really moving, it is preparing the job for processing
197
- return moveJobFromWaitToActive(KEYS, ARGV[1], jobId, ARGV[2], opts)
196
+ return moveJobFromWaitToActive(KEYS, ARGV[1], target, jobId, ARGV[2], maxJobs, expireTime, opts)
198
197
  end
199
198
  end
200
199
  -- Return the timestamp for the next delayed job if any.
@@ -202,6 +201,7 @@ local nextTimestamp = getNextDelayedTimestamp(KEYS[7])
202
201
  if (nextTimestamp ~= nil) then
203
202
  return { 0, 0, 0, nextTimestamp}
204
203
  end
204
+ return { 0, 0, 0, 0}
205
205
  `;
206
206
  export const moveToActive = {
207
207
  name: 'moveToActive',
@@ -54,9 +54,9 @@ end
54
54
  ]]
55
55
  local function getTargetQueueList(queueMetaKey, waitKey, pausedKey)
56
56
  if rcall("HEXISTS", queueMetaKey, "paused") ~= 1 then
57
- return waitKey
57
+ return waitKey, false
58
58
  else
59
- return pausedKey
59
+ return pausedKey, true
60
60
  end
61
61
  end
62
62
  --[[
@@ -127,16 +127,11 @@ end
127
127
  opts - lockDuration
128
128
  opts - limiter
129
129
  ]]
130
- local function moveJobFromWaitToActive(keys, keyPrefix, jobId, processedOn, opts)
130
+ local function moveJobFromWaitToActive(keys, keyPrefix, targetKey, jobId, processedOn,
131
+ maxJobs, expireTime, opts)
131
132
  -- Check if we need to perform rate limiting.
132
- local maxJobs = tonumber(opts['limiter'] and opts['limiter']['max'])
133
- local expireTime
134
- if(maxJobs) then
133
+ if maxJobs then
135
134
  local rateLimiterKey = keys[6];
136
- expireTime = tonumber(rcall("PTTL", rateLimiterKey))
137
- if expireTime <= 0 then
138
- rcall("DEL", rateLimiterKey)
139
- end
140
135
  local jobCounter = tonumber(rcall("INCR", rateLimiterKey))
141
136
  if jobCounter == 1 then
142
137
  local limiterDuration = opts['limiter'] and opts['limiter']['duration']
@@ -144,12 +139,12 @@ local function moveJobFromWaitToActive(keys, keyPrefix, jobId, processedOn, opts
144
139
  rcall("PEXPIRE", rateLimiterKey, integerDuration)
145
140
  end
146
141
  -- check if we passed rate limit, we need to remove the job and return expireTime
147
- if jobCounter > maxJobs then
142
+ if expireTime > 0 then
148
143
  -- remove from active queue and add back to the wait list
149
144
  rcall("LREM", keys[2], 1, jobId)
150
- rcall("RPUSH", keys[1], jobId)
145
+ rcall("RPUSH", targetKey, jobId)
151
146
  -- Return when we can process more jobs
152
- return {0, 0, expireTime}
147
+ return {0, 0, expireTime, 0}
153
148
  end
154
149
  end
155
150
  local jobKey = keyPrefix .. jobId
@@ -162,7 +157,7 @@ local function moveJobFromWaitToActive(keys, keyPrefix, jobId, processedOn, opts
162
157
  rcall("XADD", keys[4], "*", "event", "active", "jobId", jobId, "prev", "waiting")
163
158
  rcall("HSET", jobKey, "processedOn", processedOn)
164
159
  rcall("HINCRBY", jobKey, "attemptsMade", 1)
165
- return {rcall("HGETALL", jobKey), jobId, expireTime} -- get job data
160
+ return {rcall("HGETALL", jobKey), jobId, 0, 0} -- get job data
166
161
  end
167
162
  --[[
168
163
  Function to recursively move from waitingChildren to failed.
@@ -261,9 +256,9 @@ end
261
256
  ]]
262
257
  local function getTargetQueueList(queueMetaKey, waitKey, pausedKey)
263
258
  if rcall("HEXISTS", queueMetaKey, "paused") ~= 1 then
264
- return waitKey
259
+ return waitKey, false
265
260
  else
266
- return pausedKey
261
+ return pausedKey, true
267
262
  end
268
263
  end
269
264
  local function moveParentToWait(parentPrefix, parentId, emitEvent)
@@ -408,13 +403,15 @@ local function updateParentDepsIfNeeded(parentKey, parentQueueKey, parentDepende
408
403
  rcall("XADD", parentQueueKey .. ":events", "*", "event", "waiting", "jobId", parentId, "prev", "waiting-children")
409
404
  end
410
405
  end
411
- local function getRateLimitTTL(opts, limiterKey)
412
- local maxJobs = tonumber(opts['limiter'] and opts['limiter']['max'])
406
+ local function getRateLimitTTL(maxJobs, rateLimiterKey)
413
407
  if maxJobs then
414
- local jobCounter = tonumber(rcall("GET", limiterKey))
415
- if jobCounter ~= nil and jobCounter >= maxJobs then
416
- local pttl = rcall("PTTL", limiterKey)
417
- if pttl > 0 then
408
+ local pttl = rcall("PTTL", rateLimiterKey)
409
+ if pttl <= 0 then
410
+ rcall("DEL", rateLimiterKey)
411
+ end
412
+ local jobCounter = tonumber(rcall("GET", rateLimiterKey) or 0)
413
+ if jobCounter >= maxJobs then
414
+ if pttl > 0 then
418
415
  return pttl
419
416
  end
420
417
  end
@@ -527,23 +524,23 @@ if rcall("EXISTS", jobIdKey) == 1 then -- // Make sure job exists
527
524
  -- Check if there are delayed jobs that can be promoted
528
525
  promoteDelayedJobs(KEYS[7], target, KEYS[3],
529
526
  KEYS[4], ARGV[8], timestamp)
527
+ local maxJobs = tonumber(opts['limiter'] and opts['limiter']['max'])
530
528
  -- Check if we are rate limited first.
531
- local pttl = getRateLimitTTL(opts, KEYS[6])
532
- if pttl > 0 then return {0, 0, pttl} end
529
+ local expireTime = getRateLimitTTL(maxJobs, KEYS[6])
530
+ if expireTime > 0 then return {0, 0, expireTime, 0} end
533
531
  jobId = rcall("RPOPLPUSH", KEYS[1], KEYS[2])
534
532
  -- If jobId is special ID 0:delay, then there is no job to process
535
533
  if jobId then
536
534
  if string.sub(jobId, 1, 2) == "0:" then
537
535
  rcall("LREM", KEYS[2], 1, jobId)
538
536
  else
539
- opts = opts or cmsgpack.unpack(ARGV[4])
540
537
  -- this script is not really moving, it is preparing the job for processing
541
- return moveJobFromWaitToActive(KEYS, ARGV[8], jobId, timestamp, opts)
538
+ return moveJobFromWaitToActive(KEYS, ARGV[8], target, jobId, timestamp, maxJobs, expireTime, opts)
542
539
  end
543
540
  end
544
541
  -- Return the timestamp for the next delayed job if any.
545
542
  local nextTimestamp = getNextDelayedTimestamp(KEYS[7])
546
- if (nextTimestamp ~= nil) then
543
+ if nextTimestamp ~= nil then
547
544
  -- The result is guaranteed to be positive, since the
548
545
  -- ZRANGEBYSCORE command would have return a job otherwise.
549
546
  return {0, 0, 0, nextTimestamp}
@@ -1 +1 @@
1
- {"version":3,"file":"moveToFinished-12.js","sourceRoot":"","sources":["../../../src/scripts/moveToFinished-12.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkjBf,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,gBAAgB;IACtB,OAAO;IACP,IAAI,EAAE,EAAE;CACT,CAAC"}
1
+ {"version":3,"file":"moveToFinished-12.js","sourceRoot":"","sources":["../../../src/scripts/moveToFinished-12.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+iBf,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,gBAAgB;IACtB,OAAO;IACP,IAAI,EAAE,EAAE;CACT,CAAC"}
@@ -69,9 +69,9 @@ end
69
69
  ]]
70
70
  local function getTargetQueueList(queueMetaKey, waitKey, pausedKey)
71
71
  if rcall("HEXISTS", queueMetaKey, "paused") ~= 1 then
72
- return waitKey
72
+ return waitKey, false
73
73
  else
74
- return pausedKey
74
+ return pausedKey, true
75
75
  end
76
76
  end
77
77
  local function moveParentToWait(parentPrefix, parentId, emitEvent)
@@ -38,9 +38,9 @@ end
38
38
  ]]
39
39
  local function getTargetQueueList(queueMetaKey, waitKey, pausedKey)
40
40
  if rcall("HEXISTS", queueMetaKey, "paused") ~= 1 then
41
- return waitKey
41
+ return waitKey, false
42
42
  else
43
- return pausedKey
43
+ return pausedKey, true
44
44
  end
45
45
  end
46
46
  if rcall("ZREM", KEYS[1], jobId) == 1 then
@@ -87,9 +87,9 @@ end
87
87
  ]]
88
88
  local function getTargetQueueList(queueMetaKey, waitKey, pausedKey)
89
89
  if rcall("HEXISTS", queueMetaKey, "paused") ~= 1 then
90
- return waitKey
90
+ return waitKey, false
91
91
  else
92
- return pausedKey
92
+ return pausedKey, true
93
93
  end
94
94
  end
95
95
  local function moveParentToWait(parentPrefix, parentId, emitEvent)
@@ -24,9 +24,9 @@ local rcall = redis.call;
24
24
  ]]
25
25
  local function getTargetQueueList(queueMetaKey, waitKey, pausedKey)
26
26
  if rcall("HEXISTS", queueMetaKey, "paused") ~= 1 then
27
- return waitKey
27
+ return waitKey, false
28
28
  else
29
- return pausedKey
29
+ return pausedKey, true
30
30
  end
31
31
  end
32
32
  if (rcall("EXISTS", KEYS[1]) == 1) then
@@ -29,9 +29,9 @@ local rcall = redis.call
29
29
  ]]
30
30
  local function getTargetQueueList(queueMetaKey, waitKey, pausedKey)
31
31
  if rcall("HEXISTS", queueMetaKey, "paused") ~= 1 then
32
- return waitKey
32
+ return waitKey, false
33
33
  else
34
- return pausedKey
34
+ return pausedKey, true
35
35
  end
36
36
  end
37
37
  --[[
@@ -40,9 +40,9 @@ end
40
40
  ]]
41
41
  local function getTargetQueueList(queueMetaKey, waitKey, pausedKey)
42
42
  if rcall("HEXISTS", queueMetaKey, "paused") ~= 1 then
43
- return waitKey
43
+ return waitKey, false
44
44
  else
45
- return pausedKey
45
+ return pausedKey, true
46
46
  end
47
47
  end
48
48
  local target = getTargetQueueList(KEYS[6], KEYS[4], KEYS[5])