Revert "fix: update usage of emailer.send to not catch (as errors are no longer thrown), email error throttler"

This reverts commit d4e5259fcf.
This commit is contained in:
Julian Lam
2022-01-28 15:25:33 -05:00
parent e9588ca7b7
commit 165a1d8b76
7 changed files with 16 additions and 12 deletions

View File

@@ -194,6 +194,7 @@ async function pushToUids(uids, notification) {
}
body = posts.relativeToAbsolute(body, posts.urlRegex);
body = posts.relativeToAbsolute(body, posts.imgRegex);
let errorLogged = false;
await async.eachLimit(uids, 3, async (uid) => {
await emailer.send('notification', uid, {
path: notification.path,
@@ -203,6 +204,11 @@ async function pushToUids(uids, notification) {
body: body,
notification: notification,
showUnsubscribe: true,
}).catch((err) => {
if (!errorLogged) {
winston.error(`[emailer.send] ${err.stack}`);
errorLogged = true;
}
});
});
}