mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-11 20:58:59 +08:00
feat(scrape): add warning to document if it was concurrency limited (#1348)
* feat(scrape): add warning to document if it was concurrency limited * phrasing + test fix
This commit is contained in:
parent
670ca84ae9
commit
200de9e7e7
@ -97,7 +97,7 @@ describe("Billing tests", () => {
|
||||
const rc2 = (await creditUsage()).remaining_credits;
|
||||
|
||||
expect(rc1 - rc2).toBe(12);
|
||||
}, 300000);
|
||||
}, 600000);
|
||||
|
||||
it("bills crawl correctly", async () => {
|
||||
const rc1 = (await creditUsage()).remaining_credits;
|
||||
|
@ -84,6 +84,8 @@ async function addScrapeJobRaw(
|
||||
// logger.error("Error sending notification (concurrency limit reached): ", error);
|
||||
// });
|
||||
}
|
||||
|
||||
webScraperOptions.concurrencyLimited = true;
|
||||
|
||||
await _addScrapeJobToConcurrencyQueue(
|
||||
webScraperOptions,
|
||||
|
@ -923,6 +923,10 @@ async function processJob(job: Job & { id: string }, token: string) {
|
||||
delete doc.rawHtml;
|
||||
}
|
||||
|
||||
if (job.data.concurrencyLimited) {
|
||||
doc.warning = "This scrape job was throttled at your current concurrency limit. If you'd like to scrape faster, you can upgrade your plan." + (doc.warning ? " " + doc.warning : "");
|
||||
}
|
||||
|
||||
const data = {
|
||||
success: true,
|
||||
result: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user