unleash-client
Advanced tools
Comparing version 3.16.0 to 3.16.1
@@ -1,1 +0,1 @@ | ||
{ "name": "unleash-client-node", "version": "3.15.0", "sdkVersion": "unleash-client-node:3.15.0" } | ||
{ "name": "unleash-client-node", "version": "3.16.0", "sdkVersion": "unleash-client-node:3.16.0" } |
@@ -56,3 +56,3 @@ /// <reference types="node" /> | ||
constructor({ url, appName, instanceId, projectName, refreshInterval, timeout, headers, customHeadersFunction, httpOptions, namePrefix, tags, bootstrapProvider, bootstrapOverride, storageProvider, }: RepositoryOptions); | ||
timedFetch(): void; | ||
timedFetch(interval: number): void; | ||
validateFeature(feature: FeatureInterface): void; | ||
@@ -59,0 +59,0 @@ start(): Promise<void>; |
@@ -121,6 +121,6 @@ "use strict"; | ||
} | ||
Repository.prototype.timedFetch = function () { | ||
Repository.prototype.timedFetch = function (interval) { | ||
var _this = this; | ||
if (this.refreshInterval > 0) { | ||
this.timer = setTimeout(function () { return _this.fetch(); }, this.refreshInterval); | ||
if (interval > 0) { | ||
this.timer = setTimeout(function () { return _this.fetch(); }, interval); | ||
if (process.env.NODE_ENV !== 'test' && typeof this.timer.unref === 'function') { | ||
@@ -272,3 +272,3 @@ this.timer.unref(); | ||
return __awaiter(this, void 0, void 0, function () { | ||
var mergedTags, url, headers, _a, res, error, data, err_3, err_4; | ||
var nextFetch, mergedTags, url, headers, _a, res, error, data, err_3, err_4, e; | ||
return __generator(this, function (_b) { | ||
@@ -280,2 +280,3 @@ switch (_b.label) { | ||
} | ||
nextFetch = this.refreshInterval; | ||
_b.label = 1; | ||
@@ -342,6 +343,13 @@ case 1: | ||
err_4 = _b.sent(); | ||
this.emit(events_2.UnleashEvents.Error, err_4); | ||
e = err_4; | ||
if (e.code === 'ECONNRESET') { | ||
nextFetch = Math.max(Math.floor(this.refreshInterval / 2), 1000); | ||
this.emit(events_2.UnleashEvents.Warn, "Socket keep alive error, retrying in ".concat(nextFetch, "ms")); | ||
} | ||
else { | ||
this.emit(events_2.UnleashEvents.Error, err_4); | ||
} | ||
return [3 /*break*/, 14]; | ||
case 13: | ||
this.timedFetch(); | ||
this.timedFetch(nextFetch); | ||
return [7 /*endfinally*/]; | ||
@@ -348,0 +356,0 @@ case 14: return [2 /*return*/]; |
{ | ||
"name": "unleash-client", | ||
"version": "3.16.0", | ||
"version": "3.16.1", | ||
"description": "Unleash Client for Node", | ||
@@ -33,3 +33,3 @@ "license": "Apache-2.0", | ||
"ip": "^1.1.5", | ||
"make-fetch-happen": "^10.0.0", | ||
"make-fetch-happen": "^10.2.1", | ||
"murmurhash3js": "^3.0.1", | ||
@@ -49,6 +49,6 @@ "semver": "^7.3.5" | ||
"@types/ip": "1.1.0", | ||
"@types/make-fetch-happen": "10.0.0", | ||
"@types/make-fetch-happen": "10.0.1", | ||
"@types/murmurhash3js": "3.0.3", | ||
"@types/node": "14.18.26", | ||
"@types/semver": "7.3.12", | ||
"@types/node": "14.18.32", | ||
"@types/semver": "7.3.13", | ||
"@typescript-eslint/eslint-plugin": "5.29.0", | ||
@@ -68,3 +68,3 @@ "@unleash/client-specification": "4.2.2", | ||
"husky": "7.0.4", | ||
"lint-staged": "12.4.1", | ||
"lint-staged": "12.5.0", | ||
"mkdirp": "1.0.4", | ||
@@ -71,0 +71,0 @@ "nock": "13.2.4", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
260622
3311
Updatedmake-fetch-happen@^10.2.1