fix(crawl-status): keep 10 megabyte pages if they're the only thing in the output

This commit is contained in:
Gergő Móricz 2024-09-27 20:41:41 +02:00
parent 975f0575b4
commit d5e2a80e4a
1 changed files with 2 additions and 2 deletions

View File

@ -84,8 +84,8 @@ export async function crawlStatusController(req: RequestWithAuth<CrawlStatusPara
}
}
// if we ran over the bytes limit, remove the last document
if (bytes > 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 {