diff options
author | masarakki <masaki182@gmail.com> | 2017-04-22 22:11:56 +0900 |
---|---|---|
committer | Eugen <eugen@zeonfederated.com> | 2017-04-22 15:11:56 +0200 |
commit | d0ec4fb8283900607e4012bb90beb959d70dd646 (patch) | |
tree | ef580e18a329df11bcc0beffa94eb3bdced8916c /streaming | |
parent | 4428cf6f07c1496e8cbf41b4af769d5777eb124b (diff) |
refactor-cores (#2308)
Diffstat (limited to 'streaming')
-rw-r--r-- | streaming/index.js | 2 |
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) => { |