Skip to content

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

fix(v1/crawl-status): handle job's returnvalue being explicitly null (db race)

Gergő Móricz461842fe8c1e
diff --git a/apps/api/src/controllers/v1/crawl-status.ts b/apps/api/src/controllers/v1/crawl-status.ts
index 1aec86c8e..ce3831f28 100644
--- a/apps/api/src/controllers/v1/crawl-status.ts
+++ b/apps/api/src/controllers/v1/crawl-status.ts
@@ -157,10 +157,10 @@ export async function crawlStatusController(
continue;
}
- if (job.returnvalue === undefined) {
+ if (job.returnvalue === undefined || job.returnvalue === null) {
logger.warn(
"Job was considered done, but returnvalue is undefined!",
- { jobId: job.id, state },
+ { jobId: job.id, state, returnvalue: job.returnvalue },
);
continue;
}