mirror of
https://github.com/mendableai/firecrawl.git
synced 2024-11-15 19:22:19 +08:00
fix(scrapeURL): reduce logs
This commit is contained in:
parent
219f4732a0
commit
d13a2e7d26
|
@ -87,7 +87,6 @@ export async function fireEngineCheckStatus(logger: Logger, jobId: string): Prom
|
|||
logger.debug("Scrape succeeded!", { jobId });
|
||||
return successParse.data;
|
||||
} else if (processingParse.success) {
|
||||
logger.debug("Scrape is still processing", { jobId });
|
||||
throw new StillProcessingError(jobId);
|
||||
} else if (failedParse.success) {
|
||||
logger.debug("Scrape job failed", { status, jobId });
|
||||
|
|
|
@ -40,7 +40,7 @@ async function performFireEngineScrape<Engine extends FireEngineScrapeRequestChr
|
|||
status = await fireEngineCheckStatus(logger.child({ method: "fireEngineCheckStatus" }), scrape.jobId)
|
||||
} catch (error) {
|
||||
if (error instanceof StillProcessingError) {
|
||||
logger.debug("Scrape is still processing...");
|
||||
// nop
|
||||
} else if (error instanceof EngineError) {
|
||||
logger.debug("Fire-engine scrape job failed.", { error, jobId: scrape.jobId });
|
||||
throw error;
|
||||
|
|
|
@ -115,16 +115,19 @@ export const transformerStack: Transformer[] = [
|
|||
];
|
||||
|
||||
export async function executeTransformers(meta: Meta, document: Document): Promise<Document> {
|
||||
const executions: [string, number][] = [];
|
||||
|
||||
for (const transformer of transformerStack) {
|
||||
const _meta = {
|
||||
...meta,
|
||||
logger: meta.logger.child({ method: "executeTransformers/" + transformer.name }),
|
||||
};
|
||||
meta.logger.debug("Executing transformer " + transformer.name + "...", { document });
|
||||
const start = Date.now();
|
||||
document = await transformer(_meta, document);
|
||||
meta.logger.debug("Finished executing transformer " + transformer.name + " (" + (Date.now() - start) + "ms)", { document });
|
||||
executions.push([transformer.name, Date.now() - start]);
|
||||
}
|
||||
|
||||
meta.logger.debug("Executed transformers.", { executions });
|
||||
|
||||
return document;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user