diff --git a/app.js b/app.js index c09f2d67c3..f6c0313abe 100644 --- a/app.js +++ b/app.js @@ -157,6 +157,13 @@ function start() { process.on('SIGTERM', shutdown); process.on('SIGINT', shutdown); process.on('SIGHUP', restart); + process.on('message', function(message) { + switch(message) { + case 'reload': + meta.reload(); + break; + } + }) process.on('uncaughtException', function(err) { winston.error(err.message); console.log(err.stack); diff --git a/loader.js b/loader.js index 83b37cbc2e..65d8381c3e 100644 --- a/loader.js +++ b/loader.js @@ -95,7 +95,8 @@ var nconf = require('nconf'), // nbb, nbbOld; var Loader = { - timesStarted: 0 + timesStarted: 0, + shutdown_queue: [] }; Loader.init = function() { @@ -106,11 +107,6 @@ Loader.init = function() { silent: process.env.NODE_ENV !== 'development' ? true : false }); - for(var x=0;x