mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-04 09:00:39 +08:00
fix(crawl): make request 0 of crawl jobs higher priority
This commit is contained in:
parent
f4466f6bb0
commit
2ca1017fc3
@ -139,6 +139,8 @@ export async function crawlController(req: Request, res: Response) {
|
|||||||
pageOptions: pageOptions,
|
pageOptions: pageOptions,
|
||||||
origin: req.body.origin ?? defaultOrigin,
|
origin: req.body.origin ?? defaultOrigin,
|
||||||
crawl_id: id,
|
crawl_id: id,
|
||||||
|
}, {
|
||||||
|
priority: 1, // prioritize request 0 of crawl jobs same as scrape jobs
|
||||||
});
|
});
|
||||||
await addCrawlJob(id, job.id);
|
await addCrawlJob(id, job.id);
|
||||||
}
|
}
|
||||||
|
@ -9,9 +9,9 @@ export async function addScrapeJob(
|
|||||||
jobId: string = uuidv4(),
|
jobId: string = uuidv4(),
|
||||||
): Promise<Job> {
|
): Promise<Job> {
|
||||||
return await getScrapeQueue().add(jobId, webScraperOptions, {
|
return await getScrapeQueue().add(jobId, webScraperOptions, {
|
||||||
|
priority: webScraperOptions.crawl_id ? 2 : 1,
|
||||||
...options,
|
...options,
|
||||||
jobId,
|
jobId,
|
||||||
priority: webScraperOptions.crawl_id ? 2 : 1,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user