File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -227,7 +227,9 @@ export class PrismaQueue<
227227 */
228228 private async poll ( ) : Promise < void > {
229229 const { maxConcurrency, pollInterval, jobInterval } = this . config ;
230- debug ( `polling queue named="${ this . name } " with maxConcurrency=${ maxConcurrency } ...` ) ;
230+ debug (
231+ `polling queue named="${ this . name } " with pollInterval=${ pollInterval } maxConcurrency=${ maxConcurrency } ...` ,
232+ ) ;
231233
232234 while ( ! this . stopped ) {
233235 // Wait for the queue to be ready
@@ -245,7 +247,7 @@ export class PrismaQueue<
245247 // Will loop until the queue is empty or stopped
246248 while ( estimatedQueueSize > 0 && ! this . stopped ) {
247249 // Will loop until the concurrency limit is reached or stopped
248- while ( this . concurrency < maxConcurrency && ! this . stopped ) {
250+ while ( estimatedQueueSize > 0 && ! this . stopped && this . concurrency < maxConcurrency ) {
249251 // debug(`concurrency=${this.concurrency}, maxConcurrency=${maxConcurrency}`);
250252 debug ( `processing job from queue named="${ this . name } "...` ) ;
251253 this . concurrency ++ ;
You can’t perform that action at this time.
0 commit comments