@tramvai/module-http-client 4.19.2 → 4.19.4
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.
|
@@ -57,9 +57,12 @@ const httpClientFactory = ({ logger, envManager, appInfo, requestManager, header
|
|
|
57
57
|
if (!isNil(forceDisabledCircuitBreaker)) {
|
|
58
58
|
adapterOptions.enableCircuitBreaker = !forceDisabledCircuitBreaker;
|
|
59
59
|
}
|
|
60
|
-
//
|
|
60
|
+
// cache @tinkoff/request instance for performance reason
|
|
61
61
|
if (!makeRequestRegistry.has(adapterOptions.name)) {
|
|
62
|
-
|
|
62
|
+
const tRequestOptions = { ...adapterOptions };
|
|
63
|
+
// prevent memory leak, because COMMAND_LINE_EXECUTION_CONTEXT_TOKEN has Request scope and linked to ChildContainer
|
|
64
|
+
delete tRequestOptions.signal;
|
|
65
|
+
makeRequestRegistry.set(adapterOptions.name, createTinkoffRequest(tRequestOptions));
|
|
63
66
|
}
|
|
64
67
|
const makeRequest = makeRequestRegistry.get(adapterOptions.name);
|
|
65
68
|
const httpClientAdapter = new HttpClientAdapter({
|
|
@@ -57,9 +57,12 @@ const httpClientFactory = ({ logger, envManager, appInfo, requestManager, header
|
|
|
57
57
|
if (!isNil(forceDisabledCircuitBreaker)) {
|
|
58
58
|
adapterOptions.enableCircuitBreaker = !forceDisabledCircuitBreaker;
|
|
59
59
|
}
|
|
60
|
-
//
|
|
60
|
+
// cache @tinkoff/request instance for performance reason
|
|
61
61
|
if (!makeRequestRegistry.has(adapterOptions.name)) {
|
|
62
|
-
|
|
62
|
+
const tRequestOptions = { ...adapterOptions };
|
|
63
|
+
// prevent memory leak, because COMMAND_LINE_EXECUTION_CONTEXT_TOKEN has Request scope and linked to ChildContainer
|
|
64
|
+
delete tRequestOptions.signal;
|
|
65
|
+
makeRequestRegistry.set(adapterOptions.name, createTinkoffRequest(tRequestOptions));
|
|
63
66
|
}
|
|
64
67
|
const makeRequest = makeRequestRegistry.get(adapterOptions.name);
|
|
65
68
|
const httpClientAdapter = new HttpClientAdapter({
|
|
@@ -66,9 +66,12 @@ const httpClientFactory = ({ logger, envManager, appInfo, requestManager, header
|
|
|
66
66
|
if (!isNil__default["default"](forceDisabledCircuitBreaker)) {
|
|
67
67
|
adapterOptions.enableCircuitBreaker = !forceDisabledCircuitBreaker;
|
|
68
68
|
}
|
|
69
|
-
//
|
|
69
|
+
// cache @tinkoff/request instance for performance reason
|
|
70
70
|
if (!makeRequestRegistry.has(adapterOptions.name)) {
|
|
71
|
-
|
|
71
|
+
const tRequestOptions = { ...adapterOptions };
|
|
72
|
+
// prevent memory leak, because COMMAND_LINE_EXECUTION_CONTEXT_TOKEN has Request scope and linked to ChildContainer
|
|
73
|
+
delete tRequestOptions.signal;
|
|
74
|
+
makeRequestRegistry.set(adapterOptions.name, tinkoffRequestHttpClientAdapter.createTinkoffRequest(tRequestOptions));
|
|
72
75
|
}
|
|
73
76
|
const makeRequest = makeRequestRegistry.get(adapterOptions.name);
|
|
74
77
|
const httpClientAdapter = new tinkoffRequestHttpClientAdapter.HttpClientAdapter({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/module-http-client",
|
|
3
|
-
"version": "4.19.
|
|
3
|
+
"version": "4.19.4",
|
|
4
4
|
"initialVersion": "0.58.99",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@tramvai/http-client": "0.4.1",
|
|
29
|
-
"@tramvai/tinkoff-request-http-client-adapter": "0.11.
|
|
30
|
-
"@tramvai/tokens-http-client": "4.19.
|
|
31
|
-
"@tramvai/tokens-common": "4.19.
|
|
32
|
-
"@tramvai/tokens-server": "4.19.
|
|
33
|
-
"@tramvai/tokens-server-private": "4.19.
|
|
29
|
+
"@tramvai/tinkoff-request-http-client-adapter": "0.11.62",
|
|
30
|
+
"@tramvai/tokens-http-client": "4.19.4",
|
|
31
|
+
"@tramvai/tokens-common": "4.19.4",
|
|
32
|
+
"@tramvai/tokens-server": "4.19.4",
|
|
33
|
+
"@tramvai/tokens-server-private": "4.19.4"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@tinkoff/request-core": "^0.9.2",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@tinkoff/utils": "^2.1.2",
|
|
42
|
-
"@tramvai/core": "4.19.
|
|
43
|
-
"@tramvai/module-common": "4.19.
|
|
44
|
-
"@tramvai/papi": "4.19.
|
|
45
|
-
"@tramvai/test-helpers": "4.19.
|
|
46
|
-
"@tramvai/test-unit": "4.19.
|
|
47
|
-
"@tramvai/test-mocks": "4.19.
|
|
42
|
+
"@tramvai/core": "4.19.4",
|
|
43
|
+
"@tramvai/module-common": "4.19.4",
|
|
44
|
+
"@tramvai/papi": "4.19.4",
|
|
45
|
+
"@tramvai/test-helpers": "4.19.4",
|
|
46
|
+
"@tramvai/test-unit": "4.19.4",
|
|
47
|
+
"@tramvai/test-mocks": "4.19.4",
|
|
48
48
|
"@tinkoff/dippy": "0.10.7",
|
|
49
49
|
"node-fetch": "^2.6.1",
|
|
50
50
|
"tslib": "^2.4.0"
|
package/tests.js
CHANGED
|
@@ -129,9 +129,12 @@ const httpClientFactory = ({ logger, envManager, appInfo, requestManager, header
|
|
|
129
129
|
if (!isNil__default["default"](forceDisabledCircuitBreaker)) {
|
|
130
130
|
adapterOptions.enableCircuitBreaker = !forceDisabledCircuitBreaker;
|
|
131
131
|
}
|
|
132
|
-
//
|
|
132
|
+
// cache @tinkoff/request instance for performance reason
|
|
133
133
|
if (!makeRequestRegistry.has(adapterOptions.name)) {
|
|
134
|
-
|
|
134
|
+
const tRequestOptions = { ...adapterOptions };
|
|
135
|
+
// prevent memory leak, because COMMAND_LINE_EXECUTION_CONTEXT_TOKEN has Request scope and linked to ChildContainer
|
|
136
|
+
delete tRequestOptions.signal;
|
|
137
|
+
makeRequestRegistry.set(adapterOptions.name, tinkoffRequestHttpClientAdapter.createTinkoffRequest(tRequestOptions));
|
|
135
138
|
}
|
|
136
139
|
const makeRequest = makeRequestRegistry.get(adapterOptions.name);
|
|
137
140
|
const httpClientAdapter = new tinkoffRequestHttpClientAdapter.HttpClientAdapter({
|