mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 12:36:02 +01:00
removed node cluster spawn procs on ports
This commit is contained in:
@@ -7,7 +7,6 @@ var winston = require('winston'),
|
||||
_ = require('underscore'),
|
||||
os = require('os'),
|
||||
nconf = require('nconf'),
|
||||
cluster = require('cluster'),
|
||||
fs = require('fs'),
|
||||
|
||||
plugins = require('../plugins'),
|
||||
@@ -127,7 +126,7 @@ module.exports = function(Meta) {
|
||||
};
|
||||
|
||||
Meta.js.minify = function(minify, callback) {
|
||||
if (!cluster.isWorker || process.env.cluster_setup === 'true') {
|
||||
if (nconf.get('isPrimary') === 'true') {
|
||||
var minifier = Meta.js.minifierProc = fork('minifier.js'),
|
||||
onComplete = function(err) {
|
||||
if (err) {
|
||||
@@ -138,7 +137,7 @@ module.exports = function(Meta) {
|
||||
winston.verbose('[meta/js] Minification complete');
|
||||
minifier.kill();
|
||||
|
||||
if (cluster.isWorker) {
|
||||
if (process.send) {
|
||||
process.send({
|
||||
action: 'js-propagate',
|
||||
cache: Meta.js.cache,
|
||||
@@ -214,7 +213,7 @@ module.exports = function(Meta) {
|
||||
mapPath = path.join(__dirname, '../../public/nodebb.min.js.map');
|
||||
fs.exists(scriptPath, function(exists) {
|
||||
if (exists) {
|
||||
if (!cluster.isWorker || process.env.cluster_setup === 'true') {
|
||||
if (nconf.get('isPrimary') === 'true') {
|
||||
winston.verbose('[meta/js] (Experimental) Reading client-side scripts from file');
|
||||
async.map([scriptPath, mapPath], fs.readFile, function(err, files) {
|
||||
Meta.js.cache = files[0];
|
||||
|
||||
Reference in New Issue
Block a user