closes #2289, replace Infinity with '+inf'

v1.18.x
barisusakli 10 years ago
parent dcba272dc5
commit c56b9aafff

@ -75,7 +75,7 @@ module.exports = function(Categories) {
async.parallel({
pinnedTids: function(next) {
db.getSortedSetRevRangeByScore('cid:' + category.cid + ':tids', 0, -1, Infinity, Date.now(), next);
db.getSortedSetRevRangeByScore('cid:' + category.cid + ':tids', 0, -1, '+inf', Date.now(), next);
},
tids: function(next) {
db.getSortedSetRevRangeByScore('cid:' + category.cid + ':tids', 0, Math.max(0, count), Date.now(), 0, next);

@ -167,10 +167,10 @@ module.exports = function(db, module) {
}
var scoreQuery = {};
if (min !== -Infinity) {
if (min !== '-inf') {
scoreQuery.$gte = min;
}
if (max !== Infinity) {
if (max !== '+inf') {
scoreQuery.$lte = max;
}

@ -94,7 +94,7 @@ var db = require('./database'),
min = 0;
}
db.getSortedSetRevRangeByScore('messages:uid:' + uids[0] + ':to:' + uids[1], 0, count, Infinity, min, function(err, mids) {
db.getSortedSetRevRangeByScore('messages:uid:' + uids[0] + ':to:' + uids[1], 0, count, '+inf', min, function(err, mids) {
if (err) {
return callback(err);
}

@ -19,7 +19,7 @@ module.exports = function(Posts) {
var count = parseInt(stop, 10) === -1 ? stop : stop - start + 1;
db.getSortedSetRevRangeByScore('posts:pid', start, count, Infinity, Date.now() - since, function(err, pids) {
db.getSortedSetRevRangeByScore('posts:pid', start, count, '+inf', Date.now() - since, function(err, pids) {
if (err) {
return callback(err);
}

@ -55,7 +55,7 @@ module.exports = function(Topics) {
var count = parseInt(end, 10) === -1 ? end : end - start + 1;
db.getSortedSetRevRangeByScore('topics:recent', start, count, Infinity, Date.now() - since, callback);
db.getSortedSetRevRangeByScore('topics:recent', start, count, '+inf', Date.now() - since, callback);
};
Topics.updateTimestamp = function(tid, timestamp, callback) {

@ -66,10 +66,10 @@ module.exports = function(Topics) {
user.getIgnoredCategories(uid, next);
},
recentTids: function(next) {
db.getSortedSetRevRangeByScoreWithScores('topics:recent', 0, -1, Infinity, yesterday, next);
db.getSortedSetRevRangeByScoreWithScores('topics:recent', 0, -1, '+inf', yesterday, next);
},
userScores: function(next) {
db.getSortedSetRevRangeByScoreWithScores('uid:' + uid + ':tids_read', 0, -1, Infinity, yesterday, next);
db.getSortedSetRevRangeByScoreWithScores('uid:' + uid + ':tids_read', 0, -1, '+inf', yesterday, next);
}
}, function(err, results) {
if (err) {

Loading…
Cancel
Save