fix(v1/map): add wrapper around tryGetSitemap
This commit is contained in:
@@ -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)
|
||||||
) {
|
) {
|
||||||
|
try {
|
||||||
await crawler.tryGetSitemap(urls => {
|
await crawler.tryGetSitemap(urls => {
|
||||||
links.push(...urls);
|
links.push(...urls);
|
||||||
}, true, false, 30000);
|
}, true, false, 30000);
|
||||||
|
} catch (e) {
|
||||||
|
logger.warn("tryGetSitemap threw an error", { error: e });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cachedResult) {
|
if (!cachedResult) {
|
||||||
|
|||||||
Reference in New Issue
Block a user