mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-04-22 14:09:45 +08:00
feat(fetch): don't time out (for smart scrape)
This commit is contained in:
parent
0abe60085b
commit
13bd50ad2b
@ -4,6 +4,7 @@ import * as Sentry from "@sentry/node";
|
|||||||
import { MockState, saveMock } from "./mock";
|
import { MockState, saveMock } from "./mock";
|
||||||
import { TimeoutSignal } from "../../../controllers/v1/types";
|
import { TimeoutSignal } from "../../../controllers/v1/types";
|
||||||
import { fireEngineURL } from "../engines/fire-engine/scrape";
|
import { fireEngineURL } from "../engines/fire-engine/scrape";
|
||||||
|
import { fetch, RequestInit, Response, FormData, Agent } from "undici";
|
||||||
|
|
||||||
export type RobustFetchParams<Schema extends z.Schema<any>> = {
|
export type RobustFetchParams<Schema extends z.Schema<any>> = {
|
||||||
url: string;
|
url: string;
|
||||||
@ -78,6 +79,10 @@ export async function robustFetch<
|
|||||||
...(headers !== undefined ? headers : {}),
|
...(headers !== undefined ? headers : {}),
|
||||||
},
|
},
|
||||||
signal: abort,
|
signal: abort,
|
||||||
|
dispatcher: new Agent({
|
||||||
|
headersTimeout: 0,
|
||||||
|
bodyTimeout: 0,
|
||||||
|
}),
|
||||||
...(body instanceof FormData
|
...(body instanceof FormData
|
||||||
? {
|
? {
|
||||||
body,
|
body,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user