check online from users:online zset

v1.18.x
barisusakli 9 years ago
parent 54901afe5e
commit 60e1831152

@ -321,7 +321,7 @@ module.exports = function(db, module) {
return callback();
}
value = helpers.valueToString(value);
db.collection('objects').findOne({_key:key, value: value}, {fields:{_id: 0, score: 1}}, function(err, result) {
db.collection('objects').findOne({_key: key, value: value}, {fields:{_id: 0, score: 1}}, function(err, result) {
callback(err, result ? result.score : null);
});
};

@ -135,7 +135,7 @@ var async = require('async'),
};
User.isOnline = function(uid, callback) {
User.getUserField(uid, 'lastonline', function(err, lastonline) {
db.sortedSetScore('users:online', uid, function(err, lastonline) {
if (err) {
return callback(err);
}

Loading…
Cancel
Save