This commit is contained in:
Julian Lam
2013-11-22 11:42:42 -05:00
parent a7216caa3b
commit 08ef67e824
9 changed files with 124 additions and 46 deletions

View File

@@ -221,6 +221,9 @@ var RDB = require('./redis.js'),
var args = ['topics:recent', '+inf', timestamp - since, 'LIMIT', start, end - start + 1];
RDB.zrevrangebyscore(args, function(err, tids) {
if (err) {
return callback(err);
}
var latestTopics = {
'category_name': 'Recent',
@@ -234,13 +237,13 @@ var RDB = require('./redis.js'),
if (!tids || !tids.length) {
latestTopics.no_topics_message = 'show';
callback(latestTopics);
callback(err, latestTopics);
return;
}
Topics.getTopicsByTids(tids, current_user, function(topicData) {
latestTopics.topics = topicData;
callback(latestTopics);
callback(err, latestTopics);
});
});
}