mirror of
https://github.com/kikobar/mastodon.git
synced 2024-11-16 20:22:18 +00:00
refactor-cores (#2308)
This commit is contained in:
parent
4428cf6f07
commit
d0ec4fb828
|
@ -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) => {
|
||||
|
|
Loading…
Reference in a new issue