bullmq
Advanced tools
Comparing version 5.5.3 to 5.5.4
@@ -497,2 +497,3 @@ /** | ||
queueKeys.meta, | ||
queueKeys.stalled, | ||
]; | ||
@@ -516,3 +517,9 @@ return keys.concat([ | ||
const childKey = (0, utils_1.getParentKey)(opts.child); | ||
const keys = [`${jobId}:lock`, 'active', 'waiting-children', jobId].map(name => { | ||
const keys = [ | ||
`${jobId}:lock`, | ||
'active', | ||
'waiting-children', | ||
jobId, | ||
'stalled', | ||
].map(name => { | ||
return this.queue.toKey(name); | ||
@@ -597,2 +604,3 @@ }); | ||
this.queue.keys.marker, | ||
this.queue.keys.stalled, | ||
]; | ||
@@ -599,0 +607,0 @@ const pushCmd = (lifo ? 'R' : 'L') + 'PUSH'; |
@@ -182,4 +182,13 @@ "use strict"; | ||
const bclient = await this.blockingConnection.client; | ||
/** | ||
* This is the main loop in BullMQ. Its goals are to fetch jobs from the queue | ||
* as efficiently as possible, providing concurrency and minimal unnecessary calls | ||
* to Redis. | ||
*/ | ||
while (!this.closing) { | ||
let numTotal = asyncFifoQueue.numTotal(); | ||
/** | ||
* This inner loop tries to fetch jobs concurrently, but if we are waiting for a job | ||
* to arrive at the queue we should not try to fetch more jobs (as it would be pointless) | ||
*/ | ||
while (!this.waiting && | ||
@@ -324,5 +333,2 @@ numTotal < this.opts.concurrency && | ||
} | ||
finally { | ||
this.waiting = null; | ||
} | ||
return Infinity; | ||
@@ -329,0 +335,0 @@ } |
@@ -23,5 +23,5 @@ "use strict"; | ||
tslib_1.__exportStar(require("./moveToActive-11"), exports); | ||
tslib_1.__exportStar(require("./moveToDelayed-7"), exports); | ||
tslib_1.__exportStar(require("./moveToDelayed-8"), exports); | ||
tslib_1.__exportStar(require("./moveToFinished-14"), exports); | ||
tslib_1.__exportStar(require("./moveToWaitingChildren-4"), exports); | ||
tslib_1.__exportStar(require("./moveToWaitingChildren-5"), exports); | ||
tslib_1.__exportStar(require("./obliterate-2"), exports); | ||
@@ -36,3 +36,3 @@ tslib_1.__exportStar(require("./paginate-1"), exports); | ||
tslib_1.__exportStar(require("./reprocessJob-7"), exports); | ||
tslib_1.__exportStar(require("./retryJob-10"), exports); | ||
tslib_1.__exportStar(require("./retryJob-11"), exports); | ||
tslib_1.__exportStar(require("./saveStacktrace-1"), exports); | ||
@@ -39,0 +39,0 @@ tslib_1.__exportStar(require("./updateData-1"), exports); |
@@ -495,2 +495,3 @@ /** | ||
queueKeys.meta, | ||
queueKeys.stalled, | ||
]; | ||
@@ -514,3 +515,9 @@ return keys.concat([ | ||
const childKey = getParentKey(opts.child); | ||
const keys = [`${jobId}:lock`, 'active', 'waiting-children', jobId].map(name => { | ||
const keys = [ | ||
`${jobId}:lock`, | ||
'active', | ||
'waiting-children', | ||
jobId, | ||
'stalled', | ||
].map(name => { | ||
return this.queue.toKey(name); | ||
@@ -595,2 +602,3 @@ }); | ||
this.queue.keys.marker, | ||
this.queue.keys.stalled, | ||
]; | ||
@@ -597,0 +605,0 @@ const pushCmd = (lifo ? 'R' : 'L') + 'PUSH'; |
@@ -179,4 +179,13 @@ import * as fs from 'fs'; | ||
const bclient = await this.blockingConnection.client; | ||
/** | ||
* This is the main loop in BullMQ. Its goals are to fetch jobs from the queue | ||
* as efficiently as possible, providing concurrency and minimal unnecessary calls | ||
* to Redis. | ||
*/ | ||
while (!this.closing) { | ||
let numTotal = asyncFifoQueue.numTotal(); | ||
/** | ||
* This inner loop tries to fetch jobs concurrently, but if we are waiting for a job | ||
* to arrive at the queue we should not try to fetch more jobs (as it would be pointless) | ||
*/ | ||
while (!this.waiting && | ||
@@ -321,5 +330,2 @@ numTotal < this.opts.concurrency && | ||
} | ||
finally { | ||
this.waiting = null; | ||
} | ||
return Infinity; | ||
@@ -326,0 +332,0 @@ } |
@@ -20,5 +20,5 @@ export * from './addDelayedJob-6'; | ||
export * from './moveToActive-11'; | ||
export * from './moveToDelayed-7'; | ||
export * from './moveToDelayed-8'; | ||
export * from './moveToFinished-14'; | ||
export * from './moveToWaitingChildren-4'; | ||
export * from './moveToWaitingChildren-5'; | ||
export * from './obliterate-2'; | ||
@@ -33,5 +33,5 @@ export * from './paginate-1'; | ||
export * from './reprocessJob-7'; | ||
export * from './retryJob-10'; | ||
export * from './retryJob-11'; | ||
export * from './saveStacktrace-1'; | ||
export * from './updateData-1'; | ||
export * from './updateProgress-3'; |
@@ -20,5 +20,5 @@ export * from './addDelayedJob-6'; | ||
export * from './moveToActive-11'; | ||
export * from './moveToDelayed-7'; | ||
export * from './moveToDelayed-8'; | ||
export * from './moveToFinished-14'; | ||
export * from './moveToWaitingChildren-4'; | ||
export * from './moveToWaitingChildren-5'; | ||
export * from './obliterate-2'; | ||
@@ -33,3 +33,3 @@ export * from './paginate-1'; | ||
export * from './reprocessJob-7'; | ||
export * from './retryJob-10'; | ||
export * from './retryJob-11'; | ||
export * from './saveStacktrace-1'; | ||
@@ -36,0 +36,0 @@ export * from './updateData-1'; |
{ | ||
"name": "bullmq", | ||
"version": "5.5.3", | ||
"version": "5.5.4", | ||
"description": "Queue for messages and jobs based on Redis", | ||
@@ -5,0 +5,0 @@ "homepage": "https://bullmq.io/", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1482591
664
23844