Skip to content

Commit

Permalink
chore(queue): remove nested poll call as it leads to memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
mgcrea committed May 29, 2024
1 parent 1d2ab63 commit 5aaef4d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"prettier-plugin-organize-imports": "^3.2.4",
"prisma": "5.14.0",
"tsup": "^8.0.2",
"tsx": "^4.10.2",
"tsx": "^4.11.0",
"typescript": "^5.4.5",
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^1.6.0"
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions src/PrismaQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,6 @@ export class PrismaQueue<
.catch((error) => this.emit("error", error))
.finally(() => {
this.concurrency--;
// Trigger an immediate next job processing if possible.
if (this.concurrency < maxConcurrency && !this.stopped) {
setImmediate(() => this.poll());
}
}),
);
await waitFor(jobInterval);
Expand Down

0 comments on commit 5aaef4d

Please sign in to comment.