zero downtime and reload support with cluster module

This commit is contained in:
Julian Lam
2014-09-04 17:09:57 -04:00
parent 3918b29233
commit 08abbe19bc
7 changed files with 65 additions and 24 deletions

View File

@@ -14,6 +14,7 @@ var groups = require('../groups'),
async = require('async'),
winston = require('winston'),
index = require('./index'),
cluster = require('cluster'),
SocketAdmin = {
user: require('./admin/user'),
@@ -39,7 +40,13 @@ SocketAdmin.before = function(socket, method, next) {
};
SocketAdmin.reload = function(socket, data, callback) {
meta.reload(callback);
if (cluster.isWorker) {
process.send({
action: 'reload'
});
} else {
meta.reload(callback);
}
};
SocketAdmin.restart = function(socket, data, callback) {