@lad-tech/nsc-toolkit 2.0.2 → 2.0.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.
- package/CHANGELOG.md +2 -2
- package/dist/Root.js +3 -4
- package/dist/Service.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
## [2.0.
|
|
1
|
+
## [2.0.4](https://github.com/lad-tech/nsc-toolkit/compare/v2.0.3...v2.0.4) (2025-11-05)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
* logic for default request timeout ([#156](https://github.com/lad-tech/nsc-toolkit/issues/156)) ([2caf9db](https://github.com/lad-tech/nsc-toolkit/commit/2caf9dbef492c631e9980a24abab84a372a01312))
|
package/dist/Root.js
CHANGED
|
@@ -42,13 +42,12 @@ class Root {
|
|
|
42
42
|
}
|
|
43
43
|
getExpired(expired, ownTimeout) {
|
|
44
44
|
try {
|
|
45
|
-
if (!expired) {
|
|
46
|
-
const timeout =
|
|
45
|
+
if (!expired && !ownTimeout) {
|
|
46
|
+
const timeout = this.castToNumber(this.getSettingFromEnv('DEFAULT_RESPONSE_TIMEOUT'));
|
|
47
47
|
return Date.now() + timeout;
|
|
48
48
|
}
|
|
49
49
|
if (ownTimeout) {
|
|
50
|
-
|
|
51
|
-
return Math.min(customExpired, expired);
|
|
50
|
+
return Date.now() + ownTimeout;
|
|
52
51
|
}
|
|
53
52
|
return expired;
|
|
54
53
|
}
|
package/dist/Service.js
CHANGED
|
@@ -133,7 +133,7 @@ class Service extends Root_1.Root {
|
|
|
133
133
|
const span = tracer.startSpan(func.name, undefined, context);
|
|
134
134
|
try {
|
|
135
135
|
const result = func.apply(funcContext, arg);
|
|
136
|
-
if (result.then) {
|
|
136
|
+
if (result === null || result === void 0 ? void 0 : result.then) {
|
|
137
137
|
return result.then((result) => {
|
|
138
138
|
this.finishSpan(span, undefined, tag);
|
|
139
139
|
return result;
|
|
@@ -266,7 +266,7 @@ class Service extends Root_1.Root {
|
|
|
266
266
|
this.rootSpans.set(newBaggage.traceId, span);
|
|
267
267
|
return {
|
|
268
268
|
...newBaggage,
|
|
269
|
-
expired: this.getExpired(
|
|
269
|
+
expired: this.getExpired(newBaggage.expired, ownTimeout),
|
|
270
270
|
};
|
|
271
271
|
}
|
|
272
272
|
/**
|