Skip to content

Commit

Permalink
Update link-checker.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblogan authored Feb 29, 2024
1 parent 0a7e95b commit b58ec0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tasks/link-checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ const retrieveLinks = async (siteMapUrls, visitedLinks, localDomain) => {
let response = await page.goto(url, { waitUntil: 'domcontentloaded' });
await new Promise((r) => setTimeout(r, 100)); // localhost hangs on wait for idle so use a short timeout instead
if (response && response.status() && response.status() === 200) {
console.log(`successfully visited ${url} to retrieve links`);
visitedLinks[url] = true;

const urlList = await page.evaluate(async (url) => {
Expand All @@ -82,6 +81,7 @@ const retrieveLinks = async (siteMapUrls, visitedLinks, localDomain) => {
return urls;
}, url);

console.log(`successfully visited ${url} to retrieve links ${urlList.length} links found`);
urlList.forEach((link) => {
if (
!CRAWLER_EXCEPTIONS.includes(link.url) &&
Expand Down

0 comments on commit b58ec0c

Please sign in to comment.