mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: tweak logic for topic counters sorted sets, #12642
This commit is contained in:
@@ -51,7 +51,7 @@ module.exports = function (Topics) {
|
||||
`cid:${topicData.cid}:uid:${topicData.uid}:tids`,
|
||||
];
|
||||
const countedSortedSetKeys = [
|
||||
...['views', 'posts', 'votes'].map(prop => `${topicData.cid === -1 ? 'topicsRemote' : 'topics'}:${prop}`),
|
||||
...['views', 'posts', 'votes'].map(prop => `${utils.isNumber(tid) ? 'topics' : 'topicsRemote'}:${prop}`),
|
||||
`cid:${topicData.cid}:tids:votes`,
|
||||
`cid:${topicData.cid}:tids:posts`,
|
||||
`cid:${topicData.cid}:tids:views`,
|
||||
|
||||
@@ -93,11 +93,9 @@ module.exports = function (Topics) {
|
||||
db.sortedSetsRemove([
|
||||
'topics:tid',
|
||||
'topics:recent',
|
||||
'topics:posts',
|
||||
'topics:views',
|
||||
'topics:votes',
|
||||
'topics:scheduled',
|
||||
], tid),
|
||||
db.sortedSetsRemove(['views', 'posts', 'votes'].map(prop => `${utils.isNumber(tid) ? 'topics' : 'topicsRemote'}:${prop}`), tid),
|
||||
deleteTopicFromCategoryAndUser(tid),
|
||||
Topics.deleteTopicTags(tid),
|
||||
Topics.events.purge(tid),
|
||||
|
||||
Reference in New Issue
Block a user