mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-02 12:50:00 +01:00
delete topic post sorted sets on topic purge
This commit is contained in:
@@ -45,7 +45,11 @@ module.exports = function(Topics) {
|
||||
Topics.purge = function(tid, callback) {
|
||||
async.parallel([
|
||||
function(next) {
|
||||
db.deleteAll(['tid:' + tid + ':followers', 'tid:' + tid + ':read_by_uid'], next);
|
||||
db.deleteAll([
|
||||
'tid:' + tid + ':followers',
|
||||
'tid:' + tid + ':posts',
|
||||
'tid:' + tid + ':posts:votes'
|
||||
], next);
|
||||
},
|
||||
function(next) {
|
||||
db.sortedSetsRemove(['topics:tid', 'topics:recent', 'topics:posts', 'topics:views'], tid, next);
|
||||
|
||||
@@ -218,14 +218,7 @@ module.exports = function(Topics) {
|
||||
};
|
||||
|
||||
Topics.removePostFromTopic = function(tid, pid, callback) {
|
||||
async.parallel([
|
||||
function (next) {
|
||||
db.sortedSetRemove('tid:' + tid + ':posts', pid, next);
|
||||
},
|
||||
function (next) {
|
||||
db.sortedSetRemove('tid:' + tid + ':posts:votes', pid, next);
|
||||
}
|
||||
], function(err, results) {
|
||||
db.sortedSetsRemove(['tid:' + tid + ':posts', 'tid:' + tid + ':posts:votes'], pid, function(err) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user