Skip to content

Commit

Permalink
fix: recursive call
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiAlexandruParaschiv committed Aug 14, 2024
1 parent ac20bbf commit d489daf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sitemap/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,10 @@ export async function getBaseUrlPagesFromSitemaps(baseUrl, urls, log) {
if (urlData.existsAndIsValid) {
if (urlData.details && urlData.details.isSitemapIndex) {
log.info(`Sitemap Index found: ${url}`);
// Ensure we await the result of getSitemapUrlsFromSitemapIndex

// Await the promise returned by `getSitemapUrlsFromSitemapIndex`
// eslint-disable-next-line no-await-in-loop,max-len
const extractedSitemaps = getSitemapUrlsFromSitemapIndex(urlData.details.sitemapContent, log, fetchContent);
const extractedSitemaps = await getSitemapUrlsFromSitemapIndex(urlData.details.sitemapContent, log, fetchContent);
log.info(`Extracted Sitemaps from Index: ${JSON.stringify(extractedSitemaps)}`);

for (const extractedSitemapUrl of extractedSitemaps) {
Expand Down

0 comments on commit d489daf

Please sign in to comment.