use processSortedSet instead of getting all users

This commit is contained in:
barisusakli
2014-10-26 20:10:57 -04:00
parent 782896997d
commit c4a39c8163
5 changed files with 34 additions and 46 deletions

View File

@@ -9,11 +9,7 @@ var async = require('async'),
module.exports = function(Categories) {
Categories.purge = function(cid, callback) {
batch.processSortedSet('categories:' + cid + ':tid', function(err, tids, next) {
if (err) {
return callback(err);
}
batch.processSortedSet('categories:' + cid + ':tid', function(tids, next) {
async.eachLimit(tids, 10, function(tid, next) {
threadTools.purge(tid, 0, next);
}, next);