mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-08 14:19:01 +08:00
fix(v1/map): add wrapper around tryGetSitemap
This commit is contained in:
parent
5aad21b35a
commit
5a039e7b64
@ -171,9 +171,13 @@ export async function getMapResults({
|
|||||||
(sitemapIndexResult.urls.length < 100 ||
|
(sitemapIndexResult.urls.length < 100 ||
|
||||||
new Date(sitemapIndexResult.lastUpdated) < twoDaysAgo)
|
new Date(sitemapIndexResult.lastUpdated) < twoDaysAgo)
|
||||||
) {
|
) {
|
||||||
await crawler.tryGetSitemap(urls => {
|
try {
|
||||||
links.push(...urls);
|
await crawler.tryGetSitemap(urls => {
|
||||||
}, true, false, 30000);
|
links.push(...urls);
|
||||||
|
}, true, false, 30000);
|
||||||
|
} catch (e) {
|
||||||
|
logger.warn("tryGetSitemap threw an error", { error: e });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cachedResult) {
|
if (!cachedResult) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user