refactor-cores (#2308)

th-downstream
masarakki 8 years ago committed by Eugen
parent 00eb2d461a
commit 4ca919cb50

@ -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