mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-13 09:28:58 +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;
|
const rc2 = (await creditUsage()).remaining_credits;
|
||||||
|
|
||||||
expect(rc1 - rc2).toBe(12);
|
expect(rc1 - rc2).toBe(12);
|
||||||
}, 300000);
|
}, 600000);
|
||||||
|
|
||||||
it("bills crawl correctly", async () => {
|
it("bills crawl correctly", async () => {
|
||||||
const rc1 = (await creditUsage()).remaining_credits;
|
const rc1 = (await creditUsage()).remaining_credits;
|
||||||
|
@ -85,6 +85,8 @@ async function addScrapeJobRaw(
|
|||||||
// });
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
webScraperOptions.concurrencyLimited = true;
|
||||||
|
|
||||||
await _addScrapeJobToConcurrencyQueue(
|
await _addScrapeJobToConcurrencyQueue(
|
||||||
webScraperOptions,
|
webScraperOptions,
|
||||||
options,
|
options,
|
||||||
|
@ -923,6 +923,10 @@ async function processJob(job: Job & { id: string }, token: string) {
|
|||||||
delete doc.rawHtml;
|
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 = {
|
const data = {
|
||||||
success: true,
|
success: true,
|
||||||
result: {
|
result: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user