Skip to content

Commit

Permalink
feat(update): minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mgcrea committed Jun 28, 2024
1 parent e7cd9e1 commit baa8576
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/PrismaQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ export class PrismaQueue<
*/
private async poll(): Promise<void> {
const { maxConcurrency, pollInterval, jobInterval } = this.config;
debug(`polling queue named="${this.name}" with maxConcurrency=${maxConcurrency}...`);
debug(
`polling queue named="${this.name}" with pollInterval=${pollInterval} maxConcurrency=${maxConcurrency}...`,
);

while (!this.stopped) {
// Wait for the queue to be ready
Expand All @@ -245,7 +247,7 @@ export class PrismaQueue<
// Will loop until the queue is empty or stopped
while (estimatedQueueSize > 0 && !this.stopped) {
// Will loop until the concurrency limit is reached or stopped
while (this.concurrency < maxConcurrency && !this.stopped) {
while (estimatedQueueSize > 0 && !this.stopped && this.concurrency < maxConcurrency) {
// debug(`concurrency=${this.concurrency}, maxConcurrency=${maxConcurrency}`);
debug(`processing job from queue named="${this.name}"...`);
this.concurrency++;
Expand Down

0 comments on commit baa8576

Please sign in to comment.