limit build concurrency

This commit is contained in:
Pooya Parsa 2018-03-19 04:30:54 +03:30
parent 0b5824a765
commit f9c4f8bfb2

View File

@ -57,10 +57,10 @@ async function buildFixture(name) {
}
async function run() {
const cpuCount = cpus().length
const concurrency = Math.min(4, cpus().length)
spinner.info('Builing with concurrency of ' + cpuCount)
const limit = pLimit(cpuCount)
spinner.info('Builing with concurrency of ' + concurrency)
const limit = pLimit(concurrency)
await Promise.all(fixtures.map(fixture =>
limit(() => buildFixture(fixture))))