mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-18 17:54:10 +00:00
chore(cluster): set max #cores to 1 for now (we're maxing memory again)
This commit is contained in:
parent
35708ccc9c
commit
3f5221755c
1 changed files with 3 additions and 1 deletions
|
|
@ -8,9 +8,11 @@ var logging = require('./logging');
|
|||
var isProd = nconf.get('NODE_ENV') === 'production';
|
||||
var isDev = nconf.get('NODE_ENV') === 'development';
|
||||
|
||||
// The max num of CPUs to enable with cluster. On heroku, our app is pretty beefy in memory, so we're knocking back to 1
|
||||
var MAX_CORES = 1;
|
||||
if (cluster.isMaster && (isDev || isProd)) {
|
||||
// Fork workers.
|
||||
_.times(_.min([require('os').cpus().length,2]), function(){
|
||||
_.times(_.min([require('os').cpus().length,MAX_CORES]), function(){
|
||||
cluster.fork();
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue