Skip to content

Commit

Permalink
scripts[patch]: Fix check broken links script bug (#5307)
Browse files Browse the repository at this point in the history
* fix bug

* lint

---------

Co-authored-by: bracesproul <braceasproul@gmail.com>
  • Loading branch information
JuHyung-Son and bracesproul committed May 7, 2024
1 parent 247c46e commit 88bfa4b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libs/langchain-scripts/src/check_broken_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,9 @@ export async function checkBrokenLinks(

const batchResults = await Promise.all(batchLinksChecked);
const batchLinksCount = batchResults.reduce<number>((acc, result) => {
let accCopy = acc;
if (typeof result.linksChecked === "number") {
return acc + result.linksChecked;
accCopy += result.linksChecked;
}
// Do not push the message if we are retrying failed links
// because we will push the message again after retrying
Expand All @@ -187,7 +188,7 @@ export async function checkBrokenLinks(
if (result.failedUrls) {
failedUrls.push(...result.failedUrls);
}
return acc;
return accCopy;
}, 0);

linksChecked += batchLinksCount;
Expand Down

0 comments on commit 88bfa4b

Please sign in to comment.