refactor-cores (#2308)

rebase/4.0.0rc2
masarakki 2017-04-22 22:11:56 +09:00 committed by Eugen
parent 4428cf6f07
commit d0ec4fb828
1 changed files with 1 additions and 1 deletions

View File

@ -19,7 +19,7 @@ dotenv.config({
if (cluster.isMaster) { if (cluster.isMaster) {
// cluster master // cluster master
const core = +process.env.STREAMING_CLUSTER_NUM || (env === 'development' ? 1 : (os.cpus().length > 1 ? os.cpus().length - 1 : 1)) const core = +process.env.STREAMING_CLUSTER_NUM || (env === 'development' ? 1 : Math.max(os.cpus().length - 1, 1))
const fork = () => { const fork = () => {
const worker = cluster.fork(); const worker = cluster.fork();
worker.on('exit', (code, signal) => { worker.on('exit', (code, signal) => {