Skip to content
Snippets Groups Projects
Commit 0790aa91 authored by kuro5hin's avatar kuro5hin Committed by Eugen
Browse files

Fix streaming server worker count (#2082)

* Make sure we start at least one streaming worker, even if there's only one CPU and we're in production mode.

* Oops, let's make sure we're counting cpus right too.
parent e2a1b574
No related branches found
Tags v1.2
No related merge requests found
......@@ -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)
const core = +process.env.STREAMING_CLUSTER_NUM || (env === 'development' ? 1 : (os.cpus().length > 1 ? os.cpus().length - 1 : 1))
const fork = () => {
const worker = cluster.fork();
worker.on('exit', (code, signal) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment