mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-12-22 05:08:03 +00:00
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.
This commit is contained in:
parent
e2a1b574ab
commit
0790aa9165
|
@ -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) => {
|
||||
|
|
Loading…
Reference in a new issue