mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-06 01:56:09 +08:00
fix: add jobId for scrape
This commit is contained in:
parent
71072fef3b
commit
d57dbbd0c6
@ -12,6 +12,7 @@ import { defaultPageOptions, defaultExtractorOptions, defaultTimeout, defaultOri
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
|
||||
export async function scrapeHelper(
|
||||
jobId: string,
|
||||
req: Request,
|
||||
team_id: string,
|
||||
crawlerOptions: any,
|
||||
@ -36,7 +37,7 @@ export async function scrapeHelper(
|
||||
|
||||
const a = new WebScraperDataProvider();
|
||||
await a.setOptions({
|
||||
jobId: uuidv4(),
|
||||
jobId,
|
||||
mode: "single_urls",
|
||||
urls: [url],
|
||||
crawlerOptions: {
|
||||
@ -129,8 +130,11 @@ export async function scrapeController(req: Request, res: Response) {
|
||||
checkCredits();
|
||||
}
|
||||
|
||||
const jobId = uuidv4();
|
||||
|
||||
const startTime = new Date().getTime();
|
||||
const result = await scrapeHelper(
|
||||
jobId,
|
||||
req,
|
||||
team_id,
|
||||
crawlerOptions,
|
||||
@ -171,6 +175,7 @@ export async function scrapeController(req: Request, res: Response) {
|
||||
}
|
||||
|
||||
logJob({
|
||||
job_id: jobId,
|
||||
success: result.success,
|
||||
message: result.error,
|
||||
num_docs: 1,
|
||||
|
Loading…
x
Reference in New Issue
Block a user