mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-09 07:25:46 +01:00
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:
@@ -343,10 +343,6 @@ Emailer.sendToEmail = async (template, email, language, params) => {
|
||||
|
||||
return true;
|
||||
} catch (err) {
|
||||
if (Emailer._emailFailThrottle) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (err.code === 'ENOENT' && usingFallback) {
|
||||
Emailer.fallbackNotFound = true;
|
||||
winston.error(`[emailer/sendToEmail] ${await translator.translate('[[error:sendmail-not-found]]')}`);
|
||||
@@ -354,10 +350,6 @@ Emailer.sendToEmail = async (template, email, language, params) => {
|
||||
winston.error(`[emailer/sendToEmail] ${err.message || err.code || 'Unknown error while sending email.'}`);
|
||||
}
|
||||
|
||||
Emailer._emailFailThrottle = setTimeout(() => {
|
||||
delete Emailer._emailFailThrottle;
|
||||
}, 1000 * 60 * 5); // 5 minutes
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user