From d5e2a80e4ac9c05bc296e21af9527901ece84f26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20M=C3=B3ricz?= Date: Fri, 27 Sep 2024 20:41:41 +0200 Subject: [PATCH] fix(crawl-status): keep 10 megabyte pages if they're the only thing in the output --- apps/api/src/controllers/v1/crawl-status.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/api/src/controllers/v1/crawl-status.ts b/apps/api/src/controllers/v1/crawl-status.ts index 2ee0638c..ec427a9c 100644 --- a/apps/api/src/controllers/v1/crawl-status.ts +++ b/apps/api/src/controllers/v1/crawl-status.ts @@ -84,8 +84,8 @@ export async function crawlStatusController(req: RequestWithAuth bytesLimit) { + // if we ran over the bytes limit, remove the last document, except if it's the only document + if (bytes > bytesLimit && doneJobs.length !== 1) { doneJobs.splice(doneJobs.length - 1, 1); } } else {