fix(v1/map): add wrapper around tryGetSitemap

This commit is contained in:
Gergő Móricz 2025-01-22 19:00:46 +01:00
parent 5aad21b35a
commit 5a039e7b64

View File

@ -171,9 +171,13 @@ export async function getMapResults({
(sitemapIndexResult.urls.length < 100 ||
new Date(sitemapIndexResult.lastUpdated) < twoDaysAgo)
) {
await crawler.tryGetSitemap(urls => {
links.push(...urls);
}, true, false, 30000);
try {
await crawler.tryGetSitemap(urls => {
links.push(...urls);
}, true, false, 30000);
} catch (e) {
logger.warn("tryGetSitemap threw an error", { error: e });
}
}
if (!cachedResult) {