From d0ec4fb8283900607e4012bb90beb959d70dd646 Mon Sep 17 00:00:00 2001 From: masarakki Date: Sat, 22 Apr 2017 22:11:56 +0900 Subject: [PATCH] refactor-cores (#2308) --- streaming/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/streaming/index.js b/streaming/index.js index c7959b3069..a688d6de4f 100644 --- a/streaming/index.js +++ b/streaming/index.js @@ -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) => {