mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-09 00:52:55 +01:00
fix: update usage of emailer.send to not catch (as errors are no longer thrown), email error throttler
This commit is contained in:
@@ -79,7 +79,7 @@ module.exports = function (User) {
|
||||
subject: `[[email:welcome-to, ${meta.config.title || meta.config.browserTitle || 'NodeBB'}]]`,
|
||||
template: 'registration_accepted',
|
||||
uid: uid,
|
||||
}).catch(err => winston.error(`[emailer.send] ${err.stack}`));
|
||||
});
|
||||
const total = await db.incrObjectFieldBy('registration:queue:approval:times', 'totalTime', Math.floor((Date.now() - creation_time) / 60000));
|
||||
const counter = await db.incrObjectField('registration:queue:approval:times', 'counter');
|
||||
await db.setObjectField('registration:queue:approval:times', 'average', total / counter);
|
||||
|
||||
@@ -58,7 +58,7 @@ module.exports = function (User) {
|
||||
until: until ? (new Date(until)).toUTCString().replace(/,/g, '\\,') : false,
|
||||
reason: reason,
|
||||
};
|
||||
await emailer.send('banned', uid, data).catch(err => winston.error(`[emailer.send] ${err.stack}`));
|
||||
await emailer.send('banned', uid, data);
|
||||
|
||||
return banData;
|
||||
};
|
||||
|
||||
@@ -103,7 +103,6 @@ Digest.send = async function (data) {
|
||||
if (!data || !data.subscribers || !data.subscribers.length) {
|
||||
return emailsSent;
|
||||
}
|
||||
let errorLogged = false;
|
||||
await batch.processArray(data.subscribers, async (uids) => {
|
||||
let userData = await user.getUsersFields(uids, ['uid', 'email', 'email:confirmed', 'username', 'userslug', 'lastonline']);
|
||||
userData = userData.filter(u => u && u.email && (meta.config.includeUnverifiedEmails || u['email:confirmed']));
|
||||
@@ -142,11 +141,6 @@ Digest.send = async function (data) {
|
||||
popularTopics: topics.popular,
|
||||
interval: data.interval,
|
||||
showUnsubscribe: true,
|
||||
}).catch((err) => {
|
||||
if (!errorLogged) {
|
||||
winston.error(`[user/jobs] Could not send digest email\n[emailer.send] ${err.stack}`);
|
||||
errorLogged = true;
|
||||
}
|
||||
});
|
||||
}));
|
||||
if (data.interval !== 'alltime') {
|
||||
|
||||
@@ -59,7 +59,7 @@ UserReset.send = async function (email) {
|
||||
subject: '[[email:password-reset-requested]]',
|
||||
template: 'reset',
|
||||
uid: uid,
|
||||
}).catch(err => winston.error(`[emailer.send] ${err.stack}`));
|
||||
});
|
||||
|
||||
return code;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user