@ -45,7 +45,11 @@ module.exports = function(Topics) {
Topics.purge = function(tid, callback) {
async.parallel([
function(next) {
db.deleteAll(['tid:' + tid + ':followers', 'tid:' + tid + ':read_by_uid'], next);
db.deleteAll([
'tid:' + tid + ':followers',
'tid:' + tid + ':posts',
'tid:' + tid + ':posts:votes'
], next);
},
db.sortedSetsRemove(['topics:tid', 'topics:recent', 'topics:posts', 'topics:views'], tid, next);
@ -218,14 +218,7 @@ module.exports = function(Topics) {
};
Topics.removePostFromTopic = function(tid, pid, callback) {
function (next) {
db.sortedSetRemove('tid:' + tid + ':posts', pid, next);
db.sortedSetRemove('tid:' + tid + ':posts:votes', pid, next);
}
], function(err, results) {
db.sortedSetsRemove(['tid:' + tid + ':posts', 'tid:' + tid + ':posts:votes'], pid, function(err) {
if (err) {
return callback(err);