From 8cbd94ed2de46a56d215c7c434f78883e406e35f Mon Sep 17 00:00:00 2001 From: rafaelsideguide <150964962+rafaelsideguide@users.noreply.github.com> Date: Fri, 11 Oct 2024 09:45:51 -0300 Subject: [PATCH] fix/filters failed and unknown jobs now --- apps/api/src/controllers/v1/crawl-status.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api/src/controllers/v1/crawl-status.ts b/apps/api/src/controllers/v1/crawl-status.ts index 63331c9c..084685c7 100644 --- a/apps/api/src/controllers/v1/crawl-status.ts +++ b/apps/api/src/controllers/v1/crawl-status.ts @@ -64,7 +64,7 @@ export async function crawlStatusController(req: RequestWithAuth !jobStatuses.some(status => status[0] === id && status[1] === "failed")); // filter the job statues - jobStatuses = jobStatuses.filter(x => x[1] !== "failed"); + jobStatuses = jobStatuses.filter(x => x[1] !== "failed" && x[1] !== "unknown"); const status: Exclude["status"] = sc.cancelled ? "cancelled" : jobStatuses.every(x => x[1] === "completed") ? "completed" : "scraping"; const doneJobsLength = await getDoneJobsOrderedLength(req.params.jobId); const doneJobsOrder = await getDoneJobsOrdered(req.params.jobId, start, end ?? -1);