This commit is contained in:
barisusakli
2014-11-07 17:15:01 -05:00
parent d77bd638c4
commit 1ae39d638a
10 changed files with 101 additions and 28 deletions

View File

@@ -9,7 +9,7 @@ var async = require('async'),
module.exports = function(Categories) {
Categories.purge = function(cid, callback) {
batch.processSortedSet('categories:' + cid + ':tid', function(tids, next) {
batch.processSortedSet('cid:' + cid + ':tids', function(tids, next) {
async.eachLimit(tids, 10, function(tid, next) {
threadTools.purge(tid, 0, next);
}, next);
@@ -27,7 +27,11 @@ module.exports = function(Categories) {
db.sortedSetRemove('categories:cid', cid, next);
},
function(next) {
db.deleteAll(['categories:' + cid + ':tid', 'categories:recent_posts:cid:' + cid, 'category:' + cid], next);
db.deleteAll([
'cid:' + cid + ':tids',
'cid:' + cid + ':pids',
'category:' + cid
], next);
}
], callback);
}