You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updated getConcurrentJobs() param to be queueLifespanRemaining instead of queueLifespan, which is how param will actually be used. Also updated test with updated term.
Copy file name to clipboardExpand all lines: Models/Queue.js
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -207,13 +207,13 @@ export class Queue {
207
207
* worker function that has concurrency X > 1, then X related (jobs with same name)
208
208
* jobs will be returned.
209
209
*
210
-
* If queue is running with a lifespan, only jobs with timeouts at least 500ms < than lifespan
210
+
* If queue is running with a lifespan, only jobs with timeouts at least 500ms < than REMAINING lifespan
211
211
* AND a set timeout (ie timeout > 0) will be returned. See Queue.start() for more info.
212
212
*
213
-
* @paramqueueLifespan {number} - The lifespan of the current queue process (defaults to indefinite lifespan).
213
+
* @paramqueueLifespanRemaining {number} - The remaining lifespan of the current queue process (defaults to indefinite).
214
214
* @return {promise} - Promise resolves to an array of job(s) to be processed next by the queue.
215
215
*/
216
-
asyncgetConcurrentJobs(queueLifespan=0){
216
+
asyncgetConcurrentJobs(queueLifespanRemaining=0){
217
217
218
218
letconcurrentJobs=[];
219
219
@@ -224,9 +224,9 @@ export class Queue {
224
224
225
225
// Build query string
226
226
// If queueLife
227
-
consttimeoutUpperBound=(queueLifespan-500>0) ? queueLifespan-499 : 0;// Only get jobs with timeout at least 500ms < queueLifespan.
227
+
consttimeoutUpperBound=(queueLifespanRemaining-500>0) ? queueLifespanRemaining-499 : 0;// Only get jobs with timeout at least 500ms < queueLifespanRemaining.
228
228
229
-
constinitialQuery=(queueLifespan)
229
+
constinitialQuery=(queueLifespanRemaining)
230
230
? 'active == FALSE AND failed == null AND timeout > 0 AND timeout < '+timeoutUpperBound
0 commit comments