diff --git a/.cspell/code-terms.txt b/.cspell/code-terms.txt index f4862006f..93d36512a 100644 --- a/.cspell/code-terms.txt +++ b/.cspell/code-terms.txt @@ -47,6 +47,7 @@ edgesep EMPTYSTR enddate ERDIAGRAM +eslint flatmap forwardable frontmatter diff --git a/packages/mermaid/src/docs/.vitepress/scripts/fetch-avatars.ts b/packages/mermaid/src/docs/.vitepress/scripts/fetch-avatars.ts index 23c359444..9b0617aa9 100644 --- a/packages/mermaid/src/docs/.vitepress/scripts/fetch-avatars.ts +++ b/packages/mermaid/src/docs/.vitepress/scripts/fetch-avatars.ts @@ -32,11 +32,17 @@ async function fetchAvatars() { }); contributors = JSON.parse(await readFile(pathContributors, { encoding: 'utf-8' })); - const avatars = contributors.map((name) => - download(`https://github.com/${name}.png?size=100`, getAvatarPath(name)) - ); - await Promise.allSettled(avatars); + const batchSize = 10; + for (let i = 0; i < contributors.length; i += batchSize) { + console.log( + `Processing batch ${i / batchSize + 1} of ${Math.ceil(contributors.length / batchSize)}` + ); + const batch = contributors.slice(i, i + batchSize); + await Promise.allSettled( + batch.map((name) => download(`https://github.com/${name}.png?size=100`, getAvatarPath(name))) + ); + } } void fetchAvatars();