mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 21:57:22 +01:00
fix cluster.fork
This commit is contained in:
@@ -13,7 +13,9 @@ var cores = +nconf.get("WEB_CONCURRENCY") || 0;
|
||||
|
||||
if (cores!==0 && cluster.isMaster && (isDev || isProd)) {
|
||||
// Fork workers. If config.json has CORES=x, use that - otherwise, use all cpus-1 (production)
|
||||
_.times(cores, cluster.fork);
|
||||
_.times(cores, function () {
|
||||
cluster.fork();
|
||||
});
|
||||
|
||||
cluster.on('disconnect', function(worker, code, signal) {
|
||||
var w = cluster.fork(); // replace the dead worker
|
||||
|
||||
Reference in New Issue
Block a user