fix(queue-jobs): jobs with concurrency fails may vanish

This commit is contained in:
Gergő Móricz 2024-09-26 21:18:56 +02:00
parent b696bfc854
commit 095babe70b

View File

@ -64,7 +64,7 @@ export function waitForJob(jobId: string, timeout: number) {
} else if (state === "failed") {
// console.log("failed", (await getScrapeQueue().getJob(jobId)).failedReason);
const job = await getScrapeQueue().getJob(jobId);
if (job.failedReason !== "Concurrency limit hit") {
if (job && job.failedReason !== "Concurrency limit hit") {
clearInterval(int);
reject(job.failedReason);
}