Skip to content

Node.js based forum software built for the modern web

refactor: single remove call

Barış Soner Uşaklı25ab99b91d0c
diff --git a/src/notifications.js b/src/notifications.js
index b98a987cb8..1befdc8c24 100644
--- a/src/notifications.js
+++ b/src/notifications.js
@@ -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) {