mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
perf: single db call to add all uids
This commit is contained in:
@@ -140,11 +140,11 @@ Digest.send = async function (data) {
|
|||||||
interval: data.interval,
|
interval: data.interval,
|
||||||
showUnsubscribe: true,
|
showUnsubscribe: true,
|
||||||
}).catch(err => winston.error(`[user/jobs] Could not send digest email\n[emailer.send] ${err.stack}`));
|
}).catch(err => winston.error(`[user/jobs] Could not send digest email\n[emailer.send] ${err.stack}`));
|
||||||
|
|
||||||
if (data.interval !== 'alltime') {
|
|
||||||
await db.sortedSetAdd('digest:delivery', now.getTime(), userObj.uid);
|
|
||||||
}
|
|
||||||
}));
|
}));
|
||||||
|
if (data.interval !== 'alltime') {
|
||||||
|
const now = Date.now();
|
||||||
|
await db.sortedSetAdd('digest:delivery', userData.map(() => now), userData.map(u => u.uid));
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
interval: 1000,
|
interval: 1000,
|
||||||
batch: 100,
|
batch: 100,
|
||||||
|
|||||||
Reference in New Issue
Block a user