mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-09 07:25:46 +01:00
topics.getPids will return mainPid as well
This commit is contained in:
@@ -73,7 +73,7 @@ var winston = require('winston'),
|
||||
ThreadTools.purge = function(tid, uid, callback) {
|
||||
async.parallel({
|
||||
topic: function(next) {
|
||||
topics.getTopicFields(tid, ['cid', 'mainPid'], next);
|
||||
topics.getTopicFields(tid, ['cid'], next);
|
||||
},
|
||||
pids: function(next) {
|
||||
topics.getPids(tid, next);
|
||||
@@ -83,16 +83,9 @@ var winston = require('winston'),
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
var pids = [];
|
||||
if (results.topic.mainPid) {
|
||||
pids = [results.topic.mainPid].concat(results.pids);
|
||||
} else {
|
||||
pids = results.pids;
|
||||
}
|
||||
|
||||
async.parallel([
|
||||
function(next) {
|
||||
async.eachLimit(pids, 10, posts.purge, next);
|
||||
async.eachLimit(results.pids, 10, posts.purge, next);
|
||||
},
|
||||
function(next) {
|
||||
topics.purge(tid, next);
|
||||
|
||||
Reference in New Issue
Block a user