Commit 5c862144 authored by 陈志良's avatar 陈志良

Merge branch 'remould_0727_topic_cache' into SANDBOX

parents bed73829 82ee3099
...@@ -2397,7 +2397,7 @@ router.get('/thread/:tid/get/subThreads/:type', function(req, res, next) { ...@@ -2397,7 +2397,7 @@ router.get('/thread/:tid/get/subThreads/:type', function(req, res, next) {
function(callback) { function(callback) {
var getByConditionsSelectyFieldBegin = new Date(); var getByConditionsSelectyFieldBegin = new Date();
forumThreadService.getByConditionsSelectyField({_id:tid}, 'type', function(err, thread) { forumThreadService.getByConditionsSelectyField({_id:tid}, 'type', function(err, thread) {
console.log("获取父帖子耗时:"+ Math.asb(new Date() - getByConditionsSelectyFieldBegin)); console.log("获取父帖子耗时:"+ Math.abs(new Date() - getByConditionsSelectyFieldBegin));
if (err) { if (err) {
console.error(err); console.error(err);
callback(err, null); callback(err, null);
...@@ -2419,7 +2419,7 @@ router.get('/thread/:tid/get/subThreads/:type', function(req, res, next) { ...@@ -2419,7 +2419,7 @@ router.get('/thread/:tid/get/subThreads/:type', function(req, res, next) {
var getThreadWithNotPopulateCommentBegin = new Date(); var getThreadWithNotPopulateCommentBegin = new Date();
//获取子话题数据 //获取子话题数据
forumThreadService.getThreadWithNotPopulateComment(conditions, pageNo, pageSize, sort, function(err, results) { forumThreadService.getThreadWithNotPopulateComment(conditions, pageNo, pageSize, sort, function(err, results) {
console.log("查询子帖子列表耗时:"+Math.asb(new Date() - getThreadWithNotPopulateCommentBegin)); console.log("查询子帖子列表耗时:"+Math.abs(new Date() - getThreadWithNotPopulateCommentBegin));
if (err) { if (err) {
console.error(err); console.error(err);
callback(err, null); callback(err, null);
...@@ -2439,10 +2439,10 @@ router.get('/thread/:tid/get/subThreads/:type', function(req, res, next) { ...@@ -2439,10 +2439,10 @@ router.get('/thread/:tid/get/subThreads/:type', function(req, res, next) {
if(results){ if(results){
var loadLevelBegin = new Date(); var loadLevelBegin = new Date();
util.loadLevel(ent_code, results.items, function() { util.loadLevel(ent_code, results.items, function() {
console.log("查询用户经验耗时:"+Math.asb(new Date() - loadLevelBegin)); console.log("查询用户经验耗时:"+Math.abs(new Date() - loadLevelBegin));
var handleThreadListBegin = new Date(); var handleThreadListBegin = new Date();
handleThreadList(req, results, ent_code, function(result){ handleThreadList(req, results, ent_code, function(result){
console.log("查询用户对帖子点赞耗时:"+Math.asb(new Date() - handleThreadListBegin)); console.log("查询用户对帖子点赞耗时:"+Math.abs(new Date() - handleThreadListBegin));
redis.set(key, _.assign(result, returnCode.SUCCESS)); redis.set(key, _.assign(result, returnCode.SUCCESS));
redis.expire(key, 2); redis.expire(key, 2);
res.json(_.assign(result, returnCode.SUCCESS)); res.json(_.assign(result, returnCode.SUCCESS));
......
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