From 73e7884df4ba0591668ab243148952eb1383a064 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20M=C3=B3ricz?= Date: Thu, 13 Feb 2025 17:14:24 +0100 Subject: [PATCH] fix(queue-worker/crawl): only report successful page count in num_docs (#1179) --- apps/api/src/services/queue-worker.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/api/src/services/queue-worker.ts b/apps/api/src/services/queue-worker.ts index c4ebe939..b6d101f7 100644 --- a/apps/api/src/services/queue-worker.ts +++ b/apps/api/src/services/queue-worker.ts @@ -29,6 +29,7 @@ import { getCrawl, getCrawlJobCount, getCrawlJobs, + getDoneJobsOrderedLength, lockURL, lockURLs, lockURLsIndividually, @@ -185,7 +186,7 @@ async function finishCrawlIfNeeded(job: Job & { id: string }, sc: StoredCrawl) { ); } } else { - const num_docs = await getCrawlJobCount(job.data.crawl_id); + const num_docs = await getDoneJobsOrderedLength(job.data.crawl_id); const jobStatus = sc.cancelled ? "failed" : "completed"; await logJob(