Skip to content

Commit

Permalink
fix exception handling for last ip
Browse files Browse the repository at this point in the history
  • Loading branch information
f-w committed Apr 11, 2021
1 parent f577e05 commit 252aa30
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion common/mixins/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ module.exports = function (Model, options) {
throw ex;
}
// do client retry if there are multiple addresses
for (const address of addresses) {
for (const [index, address] of addresses.entries()) {
const newSmtpCfg = Object.assign({}, smtpCfg, {
host: address.address,
});
Expand All @@ -175,6 +175,7 @@ module.exports = function (Model, options) {
}
} catch (newEx) {
if (
index < addresses.length - 1 &&
newEx.command === 'CONN' &&
['ECONNECTION', 'ETIMEDOUT'].indexOf(newEx.code) >= 0
) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "notification",
"version": "1.15.7",
"version": "1.15.8",
"dbSchemaVersion": "0.6.0",
"main": "server/server.js",
"scripts": {
Expand Down

0 comments on commit 252aa30

Please sign in to comment.