Merge remote-tracking branch 'origin/master' into socket.io1.x

v1.18.x
barisusakli 10 years ago
commit 49a73e1665

@ -4,7 +4,8 @@ var nconf = require('nconf'),
gravatar = require('gravatar'),
winston = require('winston'),
validator = require('validator'),
db = require('../database'),
meta = require('../meta'),
user = require('../user'),
topics = require('../topics'),
@ -86,6 +87,7 @@ SocketMeta.rooms.enter = function(socket, data, callback) {
};
SocketMeta.rooms.getAll = function(socket, data, callback) {
var now = Date.now();
db.sortedSetCount('users:online', now - 300000, now, function(err, onlineRegisteredCount) {
if (err) {
return callback(err);

@ -191,9 +191,9 @@ var async = require('async'),
if (set === 'users:online') {
var count = parseInt(stop, 10) === -1 ? stop : stop - start + 1;
var now = Date.now();
db.getSortedSetRevRangeByScore(set, start, count, now, now - 300000, next);
db.getSortedSetRevRangeByScore(set, start, count, now, now - 300000, callback);
} else {
db.getSortedSetRevRange(set, start, stop, next);
db.getSortedSetRevRange(set, start, stop, callback);
}
};

Loading…
Cancel
Save