Infinite Loop
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- postgresql, typescript
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 61
- Fork
- 9
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của mgcrea/prisma-queue
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
mgcrea/prisma-queue#15 ·
-
Timezone issuesĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
mgcrea/prisma-queue#10 · 2 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 25/100
mgcrea/prisma-queue#9 · 3 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
mgcrea/prisma-queue#5 · 1 bình luận · 1 reaction ·
Tất cả issue của mgcrea/prisma-queue
Issue tương tự
-
triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
mermaid-js/mermaid-live-editor#2053 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
factory
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
jessepollak/home#1455 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
lingdojo/kana-dojo#31227 · 1 bình luận · 5 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
mobile: device viewer shows dark status bar icons on its dark backdrop in light mode (Android)Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
appandflow/stim#1838 ·
Maintainer thường phản hồi trong vòng 1 ngày