Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Infinite Loop

オープン
#4 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
postgresql, typescript
領域
backend, databases

調査の方向性

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 ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

mgcrea/prisma-queue のほかの issue

mgcrea/prisma-queue の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。