|
|
|
@ -203,7 +203,7 @@ module.exports = function (Posts) {
|
|
|
|
|
await Promise.all(promises);
|
|
|
|
|
|
|
|
|
|
const parentPids = _.uniq(postsWithParents.map(p => p.toPid));
|
|
|
|
|
const counts = db.sortedSetsCard(parentPids.map(pid => `pid:${pid}:replies`));
|
|
|
|
|
const counts = await db.sortedSetsCard(parentPids.map(pid => `pid:${pid}:replies`));
|
|
|
|
|
await db.setObjectBulk(parentPids.map((pid, index) => [`post:${pid}`, { replies: counts[index] }]));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|