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 {