From 252aa3004e8778ce37e75c14545a963dbac4be08 Mon Sep 17 00:00:00 2001 From: f-w Date: Sun, 11 Apr 2021 06:11:45 -0700 Subject: [PATCH] fix exception handling for last ip --- common/mixins/common.js | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/common/mixins/common.js b/common/mixins/common.js index 97230db90..95798e4c4 100644 --- a/common/mixins/common.js +++ b/common/mixins/common.js @@ -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, }); @@ -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 ) { diff --git a/package.json b/package.json index 8e0ac89c4..49092f2f9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "notification", - "version": "1.15.7", + "version": "1.15.8", "dbSchemaVersion": "0.6.0", "main": "server/server.js", "scripts": {