Commit 1806e502 authored by 刘文胜's avatar 刘文胜

优化推荐列表查询

parent 46939f20
......@@ -56,8 +56,6 @@ router.post('/honorTitle/:id/update', function(req, res, next) {
console.error(err);
res.json(returnCode.BUSY);
} else {
//更新推荐列表redis
redisThreadList.updateRedisEsenceThreads(req.session.user.ent_code, "", '_thread_essence', function() {});
res.json(returnCode.SUCCESS);
}
});
......@@ -93,8 +91,6 @@ router.put('/honorTitle/orderIDX/:id/:order', function(req, res, next) {
if(err || !result){
return res.json(returnCode.BUSY);
}
//更新推荐列表redis
redisThreadList.updateRedisEsenceThreads(req.session.user.ent_code, "", '_thread_essence', function() {});
return res.json(_.assign({data:true}, returnCode.SUCCESS));
});
});
......@@ -143,8 +139,6 @@ router.put('/honorTitle/moveUP/:id/:order', function(req, res, next) {
if(err || !result){
return res.json(returnCode.BUSY);
}
//更新推荐列表redis
redisThreadList.updateRedisEsenceThreads(req.session.user.ent_code, "", '_thread_essence', function() {});
return res.json(_.assign({data:true}, returnCode.SUCCESS));
});
});
......
......@@ -290,8 +290,6 @@ router.post('/member/:mid/setHonorTitle', function(req, res, next) {
console.error(err);
res.json(returnCode.BUSY);
} else {
//更新推荐列表redis
redisThreadList.updateRedisEsenceThreads(ent_code, "", '_thread_essence', function() {});
res.json(returnCode.SUCCESS);
}
});
......
......@@ -242,8 +242,6 @@ router.post('/thread/:tid/update', function(req, res, next) {
if (!isNaN(req.body.status)) {
forumAboutMEService.updateThreadStatus(thread._id, thread.status)
}
//更新推荐列表redis
redisThreadList.updateRedisEsenceThreads(req.session.user.ent_code, "", '_thread_essence', function() {});
res.json({
message: "success",
data: thread,
......@@ -357,8 +355,6 @@ router.post('/thread/:tid/:fid/recommend', function(req, res, next) {
res.json(returnCode.SUCCESS);
}
} else {
//更新推荐列表redis
redisThreadList.updateRedisEsenceThreads(req.session.user.ent_code, "", '_thread_essence', function() {});
res.json(returnCode.SUCCESS);
}
}
......@@ -377,8 +373,6 @@ router.post('/thread/:tid/:fid/unRecommend', function(req, res, next) {
if (err) {
res.json(returnCode.BUSY);
} else {
//更新推荐列表redis
redisThreadList.updateRedisEsenceThreads(req.session.user.ent_code, "", '_thread_essence', function() {});
res.json(returnCode.SUCCESS);
}
});
......@@ -1677,8 +1671,6 @@ router.post('/thread/:tid/essence', function(req, res, next) {
console.error(err);
res.json(returnCode.BUSY);
} else {
//更新推荐列表redis
redisThreadList.updateRedisEsenceThreads(ent_code, "", '_thread_essence', function() {});
res.json(returnCode.SUCCESS);
}
});
......@@ -1705,8 +1697,6 @@ router.post('/thread/:tid/unEssence', function(req, res, next) {
console.error(err);
res.json(returnCode.BUSY);
} else {
//更新推荐列表redis
redisThreadList.updateRedisEsenceThreads(ent_code, "", '_thread_essence', function() {});
res.json(returnCode.SUCCESS);
}
});
......
......@@ -563,8 +563,6 @@ router.get('/thread/:tid/get', function(req, res, next) {
console.error(err);
res.json(returnCode.BUSY);
} else {
//更新推荐列表redis
redisThreadList.updateRedisEsenceThreads(req.session.user.ent_code, "", '_thread_essence', function() {});
var threads = [];
threads.push(thread);
util.loadLevel(req.session.user.ent_code, threads, function() {
......@@ -654,8 +652,6 @@ router.post('/thread/:tid/update', function(req, res, next) {
if (!isNaN(req.body.status)) {
forumAboutMEService.updateThreadStatus(thread._id, thread.status)
}
//更新推荐列表redis
redisThreadList.updateRedisEsenceThreads(req.session.user.ent_code, "", '_thread_essence', function() {});
res.json(returnCode.SUCCESS);
}
});
......@@ -910,8 +906,6 @@ router.post('/thread/:tid/comment/add', function(req, res, next) {
if (err) {
res.json(returnCode.BUSY);
} else {
//更新推荐列表redis
redisThreadList.updateRedisEsenceThreads(req.session.user.ent_code, "", '_thread_essence', function() {});
var rs = {};
rs.data = c;
res.json(_.assign(rs, returnCode.SUCCESS));
......
'use strict';
var redis=global.redis;
var expire = 60*60*3;
var expire = 60*10;
//缓存数量
var ThreadRedisCount = 50;
......@@ -125,11 +125,11 @@ exports.getRedisEsenceThreads = function(ent_code,keyID,type,callback){
};
//更新缓存列表
exports.updateRedisEsenceThreads = function(ent_code,keyID,type,callback){
/*exports.updateRedisEsenceThreads = function(ent_code,keyID,type,callback){
getEsenceThreads(ent_code, keyID,type, function(err){
callback();
});
};
};*/
//获取缓存数值
exports.getThreadRedisCount = function(){
......
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