Skip to content

Commit baa8576

Browse files
committed
feat(update): minor changes
1 parent e7cd9e1 commit baa8576

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/PrismaQueue.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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++;

0 commit comments

Comments
 (0)