diff --git a/loader.js b/loader.js index 007292bb7c..d2fc606842 100644 --- a/loader.js +++ b/loader.js @@ -37,7 +37,6 @@ Loader.init = function (callback) { } process.on('SIGHUP', Loader.restart); - process.on('SIGUSR2', Loader.reload); process.on('SIGTERM', Loader.stop); callback(); }; @@ -84,10 +83,6 @@ Loader.addWorkerEvents = function (worker) { console.log('[cluster] Restarting...'); Loader.restart(); break; - case 'reload': - console.log('[cluster] Reloading...'); - Loader.reload(); - break; case 'pubsub': workers.forEach(function (w) { w.send(message); @@ -188,14 +183,6 @@ Loader.restart = function () { }); }; -Loader.reload = function () { - workers.forEach(function (worker) { - worker.send({ - action: 'reload', - }); - }); -}; - Loader.stop = function () { killWorkers(); diff --git a/src/meta.js b/src/meta.js index cb2a381d6d..9a03c89ee6 100644 --- a/src/meta.js +++ b/src/meta.js @@ -39,26 +39,6 @@ Meta.userOrGroupExists = function (slug, callback) { }); }; -/** - * Reload deprecated as of v1.1.2+, remove in v2.x - */ -Meta.reload = function (callback) { - restart(); - callback(); -}; - -Meta.restart = function () { - pubsub.publish('meta:restart', { hostname: os.hostname() }); - restart(); -}; - -Meta.getSessionTTLSeconds = function () { - var ttlDays = 60 * 60 * 24 * (parseInt(Meta.config.loginDays, 10) || 0); - var ttlSeconds = (parseInt(Meta.config.loginSeconds, 10) || 0); - var ttl = ttlSeconds || ttlDays || 1209600; // Default to 14 days - return ttl; -}; - if (nconf.get('isPrimary') === 'true') { pubsub.on('meta:restart', function (data) { if (data.hostname !== os.hostname()) { @@ -67,6 +47,11 @@ if (nconf.get('isPrimary') === 'true') { }); } +Meta.restart = function () { + pubsub.publish('meta:restart', { hostname: os.hostname() }); + restart(); +}; + function restart() { if (process.send) { process.send({ @@ -76,3 +61,10 @@ function restart() { winston.error('[meta.restart] Could not restart, are you sure NodeBB was started with `./nodebb start`?'); } } + +Meta.getSessionTTLSeconds = function () { + var ttlDays = 60 * 60 * 24 * (parseInt(Meta.config.loginDays, 10) || 0); + var ttlSeconds = (parseInt(Meta.config.loginSeconds, 10) || 0); + var ttl = ttlSeconds || ttlDays || 1209600; // Default to 14 days + return ttl; +}; diff --git a/src/start.js b/src/start.js index 427a58830b..d16e4d3a34 100644 --- a/src/start.js +++ b/src/start.js @@ -118,19 +118,6 @@ function addProcessHandlers() { process.on('SIGTERM', shutdown); process.on('SIGINT', shutdown); process.on('SIGHUP', restart); - process.on('message', function (message) { - if (typeof message !== 'object') { - return; - } - var meta = require('./meta'); - - switch (message.action) { - case 'reload': - meta.reload(); - break; - } - }); - process.on('uncaughtException', function (err) { winston.error(err);