about summary refs log tree commit diff
path: root/streaming
diff options
context:
space:
mode:
authormasarakki <masaki182@gmail.com>2017-04-22 22:11:56 +0900
committerEugen <eugen@zeonfederated.com>2017-04-22 15:11:56 +0200
commitd0ec4fb8283900607e4012bb90beb959d70dd646 (patch)
treeef580e18a329df11bcc0beffa94eb3bdced8916c /streaming
parent4428cf6f07c1496e8cbf41b4af769d5777eb124b (diff)
refactor-cores (#2308)
Diffstat (limited to 'streaming')
-rw-r--r--streaming/index.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/streaming/index.js b/streaming/index.js
index c7959b306..a688d6de4 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) => {