From: masarakki Date: Sat, 22 Apr 2017 13:11:56 +0000 (+0900) Subject: refactor-cores (#2308) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=d0ec4fb8283900607e4012bb90beb959d70dd646;p=mastodon.git refactor-cores (#2308) --- 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) => {