mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-12 20:59:00 +08:00
feat(extract): run on original links if reranker is weird
This commit is contained in:
parent
13bd50ad2b
commit
512a2b1cd4
@ -273,28 +273,21 @@ export async function performExtraction(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const processedUrls = await Promise.all(urlPromises);
|
const processedUrls = await Promise.all(urlPromises);
|
||||||
const links = processedUrls.flat().filter((url) => url);
|
let links = processedUrls.flat().filter((url) => url);
|
||||||
logger.debug("Processed URLs.", {
|
logger.debug("Processed URLs.", {
|
||||||
linkCount: links.length,
|
linkCount: links.length,
|
||||||
});
|
});
|
||||||
|
|
||||||
log["links"] = links;
|
|
||||||
log["linksLength"] = links.length;
|
|
||||||
|
|
||||||
if (links.length === 0) {
|
if (links.length === 0) {
|
||||||
logger.error("0 links! Bailing.", {
|
links = urls.map(x => x.replace(/\*$/g, ""));
|
||||||
|
logger.warn("0 links! Doing just the original URLs. (without * wildcard)", {
|
||||||
linkCount: links.length,
|
linkCount: links.length,
|
||||||
});
|
});
|
||||||
return {
|
|
||||||
success: false,
|
|
||||||
error:
|
|
||||||
"No valid URLs found to scrape. Try adjusting your search criteria or including more URLs.",
|
|
||||||
extractId,
|
|
||||||
urlTrace: urlTraces,
|
|
||||||
totalUrlsScraped: 0,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log["links"] = links;
|
||||||
|
log["linksLength"] = links.length;
|
||||||
|
|
||||||
await updateExtract(extractId, {
|
await updateExtract(extractId, {
|
||||||
status: "processing",
|
status: "processing",
|
||||||
steps: [
|
steps: [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user