Allow worker count > cpuCount

pull/48/head v1.8.2
HardiReady 2018-10-01 09:00:40 +02:00
parent 93856f07db
commit f4f43dc227
1 changed files with 1 additions and 1 deletions

View File

@ -20,7 +20,7 @@ const {exec} = require('child_process');
const cluster = require('cluster'); const cluster = require('cluster');
const envWorkerNum = process.env.NODE_WORKER_COUNT; const envWorkerNum = process.env.NODE_WORKER_COUNT;
const cpuCount = require('os').cpus().length; const cpuCount = require('os').cpus().length;
const numWorkers = (envWorkerNum && envWorkerNum < cpuCount) ? envWorkerNum : cpuCount; const numWorkers = (envWorkerNum) ? envWorkerNum : cpuCount;
// own modules // own modules
const config = require('./config/config'); const config = require('./config/config');