Commit 4f1ac5b5 authored by 杨翌文's avatar 杨翌文

11

parent 12d75d09
......@@ -723,6 +723,7 @@ function getSubThreads(doc, sort, callback) {
function getAllThreadByFidHelp(conditions, pageNo, pageSize, sort, callback) {
console.time('count_cost');
countAllByFid(conditions, function(err, count) {
if (err) {
console.error(err);
......@@ -867,7 +868,17 @@ exports.getAllThreadByFidNoLimit = function(conditions, pageNo, pageSize, sort,
//获取全部列表数据
exports.getAllThreadByFid = function(conditions, pageNo, pageSize, sort, callback) {
getAllThreadByFidHelp(conditions, pageNo, pageSize, sort, callback);
redis.get('query_1000000', function(err, page){
if (err || !page) {
getAllThreadByFidHelp(conditions, pageNo, pageSize, sort, function(err, obj){
redis.set('query_1000000', JSON.stringify(obj));
callback(err, obj);
});
} else {
callback(null, JSON.parse(page));
}
});
};
//根据板块ID更新板块下的top为0,并把当前文章的top设为1(置顶)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment