@be-link/pos-cli-nodejs 1.0.15 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/pos/http.js +3 -2
package/package.json
CHANGED
package/pos/http.js
CHANGED
|
@@ -10,7 +10,7 @@ const BizError_1 = __importDefault(require("../errors/BizError"));
|
|
|
10
10
|
const SystemError_1 = __importDefault(require("../errors/SystemError"));
|
|
11
11
|
const axios_retry_1 = __importDefault(require("axios-retry"));
|
|
12
12
|
const axiosInstance = axios_1.default.create({
|
|
13
|
-
timeout:
|
|
13
|
+
timeout: 55000,
|
|
14
14
|
httpsAgent: new (require('https').Agent)({ keepAlive: true }),
|
|
15
15
|
httpAgent: new (require('http').Agent)({ keepAlive: true }),
|
|
16
16
|
});
|
|
@@ -19,7 +19,8 @@ const axiosInstance = axios_1.default.create({
|
|
|
19
19
|
retryCondition(error) {
|
|
20
20
|
console.info('errorMessage', error.message);
|
|
21
21
|
console.info('errorResponse', error.response ? error.response.data : null);
|
|
22
|
-
|
|
22
|
+
const isSocketHangUp = error.message.includes('socket hang up');
|
|
23
|
+
return isSocketHangUp || error.message.includes('getaddrinfo ENOTFOUND') || (Boolean(error.response) && [502, 503].includes(error.response.status));
|
|
23
24
|
},
|
|
24
25
|
retryDelay: (retryCount, error) => {
|
|
25
26
|
console.info(`retryCount: ${retryCount}, retryDelay: ${retryCount * 500}`);
|