diff --git a/app/controllers/socket.js b/app/controllers/socket.js index 59f4a18..8c573b5 100644 --- a/app/controllers/socket.js +++ b/app/controllers/socket.js @@ -10,13 +10,18 @@ module.exports.init = function(io_ext) { if (ios) { // when a new socket connects ios.sockets.on('connection', function(socket) { - logger.debug('New connection from ' + socket.id); + logger.verbose('New connection from ' + socket.id); // when it subscribes, make it join the according room socket.on('subscribe', function(topic) { logger.debug('subscribe to ' + topic); socket.join(topic); }); + // disconnect handler + socket.on('disconnect', function() { + logger.verbose('disconnected ' + socket.id); + }); + }); } return ios; @@ -65,4 +70,3 @@ module.exports.broadcastSyncInfo = function(historicSync) { if (ios) ios.sockets.in('sync').emit('status', historicSync); }; - diff --git a/plugins/mailbox.js b/plugins/mailbox.js index 74d62f5..a32da98 100644 --- a/plugins/mailbox.js +++ b/plugins/mailbox.js @@ -11,7 +11,7 @@ module.exports.init = function(ext_io, config) { io.sockets.on('connection', function(socket) { // when it requests sync, send him all pending messages socket.on('sync', function(ts) { - logger.debug('Sync requested by ' + socket.id); + logger.verbose('Sync requested by ' + socket.id); logger.debug(' from timestamp ' + ts); var rooms = socket.rooms; if (rooms.length !== 2) { @@ -25,7 +25,7 @@ module.exports.init = function(ext_io, config) { if (err) { throw new Error('Couldn\'t get messages on sync request: ' + err); } - logger.debug('\tFound ' + messages.length + ' message' + (messages.length !== 1 ? 's' : '')); + logger.verbose('\tFound ' + messages.length + ' message' + (messages.length !== 1 ? 's' : '')); for (var i = 0; i < messages.length; i++) { broadcastMessage(messages[i], socket); } @@ -42,10 +42,6 @@ module.exports.init = function(ext_io, config) { }); }); - // disconnect handler - socket.on('disconnect', function() { - logger.debug('disconnected ' + socket.id); - }); }); mdb.on('message', broadcastMessage); diff --git a/plugins/ratelimiter.js b/plugins/ratelimiter.js index 3115035..6f63403 100644 --- a/plugins/ratelimiter.js +++ b/plugins/ratelimiter.js @@ -10,9 +10,8 @@ module.exports.init = function(app, config) { config = config || {}; config.whitelistRPH = config.whitelistRPH || 5000; - config.normalRPH = config.normalRPH || 2; + config.normalRPH = config.normalRPH || 500; config.blacklistRPH = config.blacklistRPH || 0; - console.log(config); app.use(limiter({ whitelist: [],