This commit is contained in:
barisusakli
2015-09-17 13:37:04 -04:00
parent 8c2fdcc77c
commit 8af64ba984
5 changed files with 37 additions and 22 deletions

View File

@@ -4,15 +4,14 @@ var async = require('async'),
db = require('../database'),
batch = require('../batch'),
plugins = require('../plugins'),
threadTools = require('../threadTools');
topics = require('../topics');
module.exports = function(Categories) {
Categories.purge = function(cid, callback) {
batch.processSortedSet('cid:' + cid + ':tids', function(tids, next) {
async.eachLimit(tids, 10, function(tid, next) {
threadTools.purge(tid, 0, next);
topics.purgePostsAndTopic(tid, next);
}, next);
}, {alwaysStartAt: 0}, function(err) {
if (err) {