1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-13 14:18:26 +09:00
This commit is contained in:
syuilo 2018-11-21 05:26:48 +09:00
parent 79ffbf95db
commit 7c259185bc
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69

View File

@ -224,7 +224,7 @@ async function getMongoDBVersion(db: Db): Promise<string> {
return (await db.admin().serverInfo()).version;
}
async function spawnWorkers(limit: number) {
async function spawnWorkers(limit: number = Infinity) {
const workers = Math.min(limit, os.cpus().length);
Logger.info(`Starting ${workers} worker${workers === 1 ? '' : 's'}...`);
await Promise.all([...Array(workers)].map(spawnWorker));