Infinite Loop
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 30/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- postgresql, typescript
调研方向
Start at the createQueue(...).start() entry point and reproduce the behavior with the shown emailQueue.start() call and job handler. Inspect the worker's job lifecycle and database state after a job succeeds or throws. Done means the job is handled according to its outcome, is not repeatedly reported as absent, and the background worker remains usable.
由索引模型根据 Issue 内容生成。
描述
Hey! My project uses prisma and this looked pretty convenient so I wanted to give it a shot.
I'm facing an issue where the worker is getting stuck in an infinite loop. As soon as I add a job, it prints out an infinite amount of:
2024-06-14T06:50:14.123Z prisma-queue processing job from queue named="email"...
2024-06-14T06:50:14.123Z prisma-queue dequeuing from queue named="email"...
2024-06-14T06:50:14.124Z prisma-queue no jobs found in queue named="email"
2024-06-14T06:50:14.174Z prisma-queue processing job from queue named="email"...
2024-06-14T06:50:14.174Z prisma-queue dequeuing from queue named="email"...
2024-06-14T06:50:14.175Z prisma-queue no jobs found in queue named="email"
I noticed that in the DB, the job is not being removed. NOTE: I'm not awaiting the .start()
Code:
export const emailQueue = createQueue<JobPayload, JobResult>(
{ name: 'email' },
async (job, client) => {
const { id, payload } = job;
console.log(
`Processing job#${id} with payload=${JSON.stringify(payload)})`,
);
// await someAsyncMethod();
await job.progress(50);
const status = 200;
if (Math.random() > 0.5) {
throw new Error(`Failed for some unknown reason`);
}
console.log(`Finished job#${id} with status=${status}`);
return { status };
},
);
void emailQueue.start();
My use case is I'm running Next.js in a container and just want this to run in the background. So I just put the void emailQueue.start() so that it does it in the background. This strategy seems to work with pgboss
- 主要语言
- TypeScript
- 星标
- 61
- 派生
- 9
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
mgcrea/prisma-queue 的其他 Issue
-
难度 5/5 一周以上 新手友好度 35/100
mgcrea/prisma-queue#15 ·
-
Timezone issues未关闭
难度 3/5 1-2 天 新手友好度 42/100
mgcrea/prisma-queue#10 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 25/100
mgcrea/prisma-queue#9 · 3 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
mgcrea/prisma-queue#5 · 1 条评论 · 1 个 reaction ·
查看 mgcrea/prisma-queue 的全部 Issue
相似的 Issue
-
Mend: dependency security vulnerability untriaged
难度 2/5 1-3 小时 新手友好度 68/100
opensearch-project/security-dashboards-plugin#2545 ·
维护者通常 1 天内回复
-
Add: Dream TR SD未关闭check:passed streams:add
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
doctor integrity sample scans soft-deleted pages on Postgres (batch path has no deleted_at filter)未关闭
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
SocialGouv/egapro#4672 · 1 条评论 ·
维护者通常 2 天内回复
-
area:agents area:tui bug
难度 2/5 1-3 小时 新手友好度 74/100
anthropics/claude-code#98358 ·
维护者通常 1 天内回复