Skip to content

Commit

Permalink
fix: write pre-render files sequentially (fix #59)
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed May 14, 2021
1 parent 5455a22 commit 2339746
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/prerender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ async function prerender({

console.log(`${green(`✓`)} ${htmlDocuments.length} HTML documents pre-rendered.`)

await Promise.all(htmlDocuments.map((htmlDoc) => writeHtmlDocument(htmlDoc, root)))
for(const htmlDoc of htmlDocuments) { // `htmlDocuments.length` can be very big; to avoid `EMFILE, too many open files` we don't parallelize the writing
await writeHtmlDocument(htmlDoc, root)
}
}

async function writeHtmlDocument(
Expand Down

0 comments on commit 2339746

Please sign in to comment.