mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
chore(server): small updates to better support recent nodejs buildpack
This commit is contained in:
@@ -39,7 +39,7 @@
|
|||||||
"loggly": "~1.0.8",
|
"loggly": "~1.0.8",
|
||||||
"method-override": "~2.2.0",
|
"method-override": "~2.2.0",
|
||||||
"moment": "~2.8.3",
|
"moment": "~2.8.3",
|
||||||
"mongoose": "~3.8.20",
|
"mongoose": "~3.8.23",
|
||||||
"mongoose-id-autoinc": "~2013.7.14-4",
|
"mongoose-id-autoinc": "~2013.7.14-4",
|
||||||
"nconf": "~0.6.9",
|
"nconf": "~0.6.9",
|
||||||
"newrelic": "~1.11.2",
|
"newrelic": "~1.11.2",
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ utils.setupConfig();
|
|||||||
var logging = require('./logging');
|
var logging = require('./logging');
|
||||||
var isProd = nconf.get('NODE_ENV') === 'production';
|
var isProd = nconf.get('NODE_ENV') === 'production';
|
||||||
var isDev = nconf.get('NODE_ENV') === 'development';
|
var isDev = nconf.get('NODE_ENV') === 'development';
|
||||||
var cores = +nconf.get("CORES");
|
var cores = +nconf.get("WEB_CONCURRENCY") || 0;
|
||||||
|
|
||||||
if (cores!==0 && cluster.isMaster && (isDev || isProd)) {
|
if (cores!==0 && cluster.isMaster && (isDev || isProd)) {
|
||||||
// Fork workers. If config.json has CORES=x, use that - otherwise, use all cpus-1 (production)
|
// Fork workers. If config.json has CORES=x, use that - otherwise, use all cpus-1 (production)
|
||||||
_.times(cores || require('os').cpus().length-1, cluster.fork);
|
_.times(cores, cluster.fork);
|
||||||
|
|
||||||
cluster.on('disconnect', function(worker, code, signal) {
|
cluster.on('disconnect', function(worker, code, signal) {
|
||||||
var w = cluster.fork(); // replace the dead worker
|
var w = cluster.fork(); // replace the dead worker
|
||||||
|
|||||||
Reference in New Issue
Block a user