Browse Source

refactor-cores (#2308)

closed-social-glitch-2
masarakki 7 years ago
committed by Eugen
parent
commit
d0ec4fb828
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      streaming/index.js

+ 1
- 1
streaming/index.js View File

@ -19,7 +19,7 @@ dotenv.config({
if (cluster.isMaster) {
// 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 worker = cluster.fork();
worker.on('exit', (code, signal) => {

Loading…
Cancel
Save