mirror of
https://github.com/mendableai/firecrawl.git
synced 2024-11-16 11:42:24 +08:00
fix(v1/batch/scrape): raise default timeout
This commit is contained in:
parent
3a342bfbf0
commit
c95a4a26c9
|
@ -186,9 +186,10 @@ export const webhookSchema = z.preprocess(x => {
|
||||||
headers: z.record(z.string(), z.string()).default({}),
|
headers: z.record(z.string(), z.string()).default({}),
|
||||||
}).strict(strictMessage))
|
}).strict(strictMessage))
|
||||||
|
|
||||||
export const batchScrapeRequestSchema = scrapeOptions.extend({
|
export const batchScrapeRequestSchema = scrapeOptions.omit({ timeout: true }).extend({
|
||||||
urls: url.array(),
|
urls: url.array(),
|
||||||
origin: z.string().optional().default("api"),
|
origin: z.string().optional().default("api"),
|
||||||
|
timeout: z.number().int().positive().finite().safe().default(60000),
|
||||||
webhook: webhookSchema.optional(),
|
webhook: webhookSchema.optional(),
|
||||||
}).strict(strictMessage).refine(
|
}).strict(strictMessage).refine(
|
||||||
(obj) => {
|
(obj) => {
|
||||||
|
@ -199,12 +200,7 @@ export const batchScrapeRequestSchema = scrapeOptions.extend({
|
||||||
{
|
{
|
||||||
message: "When 'extract' format is specified, 'extract' options must be provided, and vice versa",
|
message: "When 'extract' format is specified, 'extract' options must be provided, and vice versa",
|
||||||
}
|
}
|
||||||
).transform((obj) => {
|
);
|
||||||
if ((obj.formats?.includes("extract") || obj.extract) && !obj.timeout) {
|
|
||||||
return { ...obj, timeout: 60000 };
|
|
||||||
}
|
|
||||||
return obj;
|
|
||||||
});
|
|
||||||
|
|
||||||
export type BatchScrapeRequest = z.infer<typeof batchScrapeRequestSchema>;
|
export type BatchScrapeRequest = z.infer<typeof batchScrapeRequestSchema>;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user