no need for pubsub in getNodeInfo

v1.18.x
barisusakli 9 years ago
parent 20ae29cce3
commit d4055ddaef

@ -62,9 +62,8 @@ function getNodeInfo(callback) {
}; };
async.parallel({ async.parallel({
pubsub: function(next) { stats: function(next) {
pubsub.publish('sync:stats:start'); rooms.getLocalStats(next);
next();
}, },
gitInfo: function(next) { gitInfo: function(next) {
getGitInfo(next); getGitInfo(next);
@ -74,7 +73,7 @@ function getNodeInfo(callback) {
return callback(err); return callback(err);
} }
data.git = results.gitInfo; data.git = results.gitInfo;
data.stats = rooms.stats[data.os.hostname + ':' + data.process.port]; data.stats = results.stats;
callback(null, data); callback(null, data);
}); });
} }

@ -17,7 +17,7 @@ var SocketRooms = {
pubsub.on('sync:stats:start', function() { pubsub.on('sync:stats:start', function() {
getLocalStats(function(err, stats) { SocketRooms.getLocalStats(function(err, stats) {
if (err) { if (err) {
return winston.error(err); return winston.error(err);
} }
@ -50,7 +50,7 @@ SocketRooms.getTotalGuestCount = function(callback) {
pubsub.removeAllListeners('sync:stats:guests:end'); pubsub.removeAllListeners('sync:stats:guests:end');
callback(null, count); callback(null, count);
}, 100); }, 100);
} };
SocketRooms.getAll = function(socket, data, callback) { SocketRooms.getAll = function(socket, data, callback) {
@ -129,7 +129,7 @@ SocketRooms.getOnlineUserCount = function(io) {
return count; return count;
}; };
function getLocalStats(callback) { SocketRooms.getLocalStats = function(callback) {
var io = require('../index').server; var io = require('../index').server;
if (!io) { if (!io) {
@ -172,7 +172,7 @@ function getLocalStats(callback) {
socketData.topics = topTenTopics; socketData.topics = topTenTopics;
callback(null, socketData); callback(null, socketData);
} };
module.exports = SocketRooms; module.exports = SocketRooms;
Loading…
Cancel
Save