@autofleet/network 1.4.8 → 1.4.9
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/index.js +5 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -96,11 +96,13 @@ module.exports = class Network {
|
|
|
96
96
|
return response;
|
|
97
97
|
}, (error) => {
|
|
98
98
|
if(error.request && error.request._currentRequest &&
|
|
99
|
-
error.request._currentRequest.reusedSocket &&
|
|
99
|
+
error.request._currentRequest.reusedSocket &&
|
|
100
|
+
['ECONNRESET', 'EPIPE'].includes(error.code)
|
|
101
|
+
) {
|
|
100
102
|
// See https://www.npmjs.com/package/agentkeepalive
|
|
101
103
|
// Support req.reusedSocket
|
|
102
104
|
// https://code-examples.net/en/q/28a8069
|
|
103
|
-
logger.warn(
|
|
105
|
+
logger.warn(`${error.code} issue, will retry`, {
|
|
104
106
|
req: error.request._currentRequest._currentUrl,
|
|
105
107
|
// method: error.request._currentRequest._options.method,
|
|
106
108
|
})
|
|
@@ -164,7 +166,7 @@ module.exports = class Network {
|
|
|
164
166
|
|
|
165
167
|
async getAllPagesFromQueryEndpoint(url, options = {}) {
|
|
166
168
|
let currentResult = [];
|
|
167
|
-
|
|
169
|
+
|
|
168
170
|
let moreResultsToLoad = true;
|
|
169
171
|
let page = 1;
|
|
170
172
|
while(moreResultsToLoad && page < 100) {
|