mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
refactor: single remove call
This commit is contained in:
@@ -327,10 +327,9 @@ Notifications.prune = async function () {
|
||||
]);
|
||||
|
||||
await batch.processSortedSet('users:joindate', async function (uids) {
|
||||
await Promise.all([
|
||||
db.sortedSetsRemoveRangeByScore(uids.map(uid => 'uid:' + uid + ':notifications:unread'), '-inf', cutoffTime),
|
||||
db.sortedSetsRemoveRangeByScore(uids.map(uid => 'uid:' + uid + ':notifications:read'), '-inf', cutoffTime),
|
||||
]);
|
||||
const unread = uids.map(uid => 'uid:' + uid + ':notifications:unread');
|
||||
const read = uids.map(uid => 'uid:' + uid + ':notifications:read');
|
||||
db.sortedSetsRemoveRangeByScore(unread.concat(read), '-inf', cutoffTime);
|
||||
}, { batch: 500, interval: 100 });
|
||||
} catch (err) {
|
||||
if (err) {
|
||||
|
||||
Reference in New Issue
Block a user