From 72c35db6fd499c08e5703b837a28a5f74029f959 Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Fri, 7 Feb 2014 11:45:13 -0500 Subject: [PATCH] cleanup in move rencet replies' --- src/categories.js | 11 +++-------- src/threadTools.js | 11 +++-------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/categories.js b/src/categories.js index 4a1e0fcef7..583358d84c 100644 --- a/src/categories.js +++ b/src/categories.js @@ -290,21 +290,16 @@ var db = require('./database'), db.sortedSetRemove('categories:recent_posts:cid:' + oldCid, pid); db.sortedSetAdd('categories:recent_posts:cid:' + cid, timestamp, pid); - callback(null); + callback(); }); } topics.getPids(tid, function(err, pids) { if(err) { - return callback(err, null); + return callback(err); } - async.each(pids, movePost, function(err) { - if(err) { - return callback(err, null); - } - callback(null, 1); - }); + async.each(pids, movePost, callback); }); }; diff --git a/src/threadTools.js b/src/threadTools.js index 87d0026171..5125eaf6a4 100644 --- a/src/threadTools.js +++ b/src/threadTools.js @@ -206,19 +206,14 @@ var winston = require('winston'), topics.setTopicField(tid, 'cid', cid); - categories.moveActiveUsers(tid, oldCid, cid); - categories.moveRecentReplies(tid, oldCid, cid, function(err, data) { - if (err) { - winston.err(err); - } - }); - if(!parseInt(topic.deleted, 10)) { categories.incrementCategoryFieldBy(oldCid, 'topic_count', -1); categories.incrementCategoryFieldBy(cid, 'topic_count', 1); } - callback(null); + categories.moveActiveUsers(tid, oldCid, cid); + + categories.moveRecentReplies(tid, oldCid, cid, callback); }); }