mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
refactor: create date once per digest.send
This commit is contained in:
@@ -88,6 +88,7 @@ Digest.send = async function (data) {
|
|||||||
return emailsSent;
|
return emailsSent;
|
||||||
}
|
}
|
||||||
let errorLogged = false;
|
let errorLogged = false;
|
||||||
|
const date = new Date();
|
||||||
await batch.processArray(data.subscribers, async (uids) => {
|
await batch.processArray(data.subscribers, async (uids) => {
|
||||||
let userData = await user.getUsersFields(uids, [
|
let userData = await user.getUsersFields(uids, [
|
||||||
'uid', 'email', 'email:confirmed', 'username', 'userslug', 'lastonline',
|
'uid', 'email', 'email:confirmed', 'username', 'userslug', 'lastonline',
|
||||||
@@ -99,7 +100,6 @@ Digest.send = async function (data) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const userSettings = await user.getMultipleUserSettings(userData.map(u => u.uid));
|
const userSettings = await user.getMultipleUserSettings(userData.map(u => u.uid));
|
||||||
const date = new Date();
|
|
||||||
await Promise.all(userData.map(async (userObj, index) => {
|
await Promise.all(userData.map(async (userObj, index) => {
|
||||||
const userSetting = userSettings[index];
|
const userSetting = userSettings[index];
|
||||||
const [publicRooms, notifications, topics] = await Promise.all([
|
const [publicRooms, notifications, topics] = await Promise.all([
|
||||||
|
|||||||
Reference in New Issue
Block a user