Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

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

Gergő Móricz095babe70b22
diff --git a/apps/api/src/services/queue-jobs.ts b/apps/api/src/services/queue-jobs.ts
index 746d4b975..315700a1e 100644
--- a/apps/api/src/services/queue-jobs.ts
+++ b/apps/api/src/services/queue-jobs.ts
@@ -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);
}