fix(scrapeURL/fire-engine): wait longer if timeout is not specified
Some checks are pending
Deploy Images to GHCR / push-app-image (push) Waiting to run

This commit is contained in:
Gergő Móricz 2024-11-15 20:25:16 +01:00
parent 4cddcd5206
commit 63787bc504

View File

@ -96,7 +96,9 @@ export async function scrapeURLWithFireEngineChromeCDP(meta: Meta): Promise<Engi
let response = await performFireEngineScrape( let response = await performFireEngineScrape(
meta.logger.child({ method: "scrapeURLWithFireEngineChromeCDP/callFireEngine", request }), meta.logger.child({ method: "scrapeURLWithFireEngineChromeCDP/callFireEngine", request }),
request, request,
defaultTimeout + totalWait, meta.options.timeout !== undefined
? defaultTimeout + totalWait
: Infinity, // TODO: better timeout handling
); );
specialtyScrapeCheck(meta.logger.child({ method: "scrapeURLWithFireEngineChromeCDP/specialtyScrapeCheck" }), response.responseHeaders); specialtyScrapeCheck(meta.logger.child({ method: "scrapeURLWithFireEngineChromeCDP/specialtyScrapeCheck" }), response.responseHeaders);
@ -148,7 +150,9 @@ export async function scrapeURLWithFireEnginePlaywright(meta: Meta): Promise<Eng
let response = await performFireEngineScrape( let response = await performFireEngineScrape(
meta.logger.child({ method: "scrapeURLWithFireEngineChromeCDP/callFireEngine", request }), meta.logger.child({ method: "scrapeURLWithFireEngineChromeCDP/callFireEngine", request }),
request, request,
defaultTimeout + meta.options.waitFor meta.options.timeout !== undefined
? defaultTimeout + meta.options.waitFor
: Infinity, // TODO: better timeout handling
); );
specialtyScrapeCheck(meta.logger.child({ method: "scrapeURLWithFireEnginePlaywright/specialtyScrapeCheck" }), response.responseHeaders); specialtyScrapeCheck(meta.logger.child({ method: "scrapeURLWithFireEnginePlaywright/specialtyScrapeCheck" }), response.responseHeaders);
@ -189,6 +193,9 @@ export async function scrapeURLWithFireEngineTLSClient(meta: Meta): Promise<Engi
let response = await performFireEngineScrape( let response = await performFireEngineScrape(
meta.logger.child({ method: "scrapeURLWithFireEngineChromeCDP/callFireEngine", request }), meta.logger.child({ method: "scrapeURLWithFireEngineChromeCDP/callFireEngine", request }),
request, request,
meta.options.timeout !== undefined
? defaultTimeout
: Infinity, // TODO: better timeout handling
); );
specialtyScrapeCheck(meta.logger.child({ method: "scrapeURLWithFireEngineTLSClient/specialtyScrapeCheck" }), response.responseHeaders); specialtyScrapeCheck(meta.logger.child({ method: "scrapeURLWithFireEngineTLSClient/specialtyScrapeCheck" }), response.responseHeaders);