makes recent unread and category pages a lot faster, added logging when a user changes their username

This commit is contained in:
Baris Soner Usakli
2014-01-13 18:02:06 -05:00
parent c07bf466b2
commit a97ee201d8
4 changed files with 15 additions and 28 deletions

View File

@@ -285,7 +285,7 @@ var winston = require('winston'),
}
ThreadTools.getLatestUndeletedPid = function(tid, callback) {
db.getSortedSetRange('tid:' + tid + ':posts', 0, -1, function(err, pids) {
db.getSortedSetRevRange('tid:' + tid + ':posts', 0, -1, function(err, pids) {
if(err) {
return callback(err);
}
@@ -293,14 +293,9 @@ var winston = require('winston'),
return callback(new Error('no-undeleted-pids-found'));
}
pids.reverse();
async.detectSeries(pids, function(pid, next) {
posts.getPostField(pid, 'deleted', function(err, deleted) {
if (parseInt(deleted, 10) === 0) {
next(true);
} else {
next(false);
}
next(parseInt(deleted, 10) === 0);
});
}, function(pid) {
if (pid) {