removed most of the db.sortedSetCards

This commit is contained in:
barisusakli
2014-10-14 23:12:47 -04:00
parent 09bd42b9f6
commit 761f56aeb1
8 changed files with 25 additions and 20 deletions

View File

@@ -214,7 +214,9 @@ var async = require('async'),
if (!parseInt(uid, 10)) {
return callback(null, 0);
}
db.sortedSetCard('uid:' + uid + ':notifications:unread', callback);
db.getSortedSetRange('uid:' + uid + ':notifications:unread', 0, 20, function(err, nids) {
callback(err, Array.isArray(nids) ? nids.length : 0);
});
};
UserNotifications.getUnreadByField = function(uid, field, value, callback) {