@lad-tech/nsc-toolkit 2.0.3 → 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 CHANGED
@@ -1,6 +1,6 @@
1
- ## [2.0.3](https://github.com/lad-tech/nsc-toolkit/compare/v2.0.2...v2.0.3) (2025-07-16)
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
- * error if func result empty ([#154](https://github.com/lad-tech/nsc-toolkit/issues/154)) ([2ae4a9d](https://github.com/lad-tech/nsc-toolkit/commit/2ae4a9de5657e79199f5e43e77efacff36265fca))
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 = ownTimeout || this.castToNumber(this.getSettingFromEnv('DEFAULT_RESPONSE_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
- const customExpired = Date.now() + ownTimeout;
51
- return Math.min(customExpired, expired);
50
+ return Date.now() + ownTimeout;
52
51
  }
53
52
  return expired;
54
53
  }
package/dist/Service.js CHANGED
@@ -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(undefined, ownTimeout),
269
+ expired: this.getExpired(newBaggage.expired, ownTimeout),
270
270
  };
271
271
  }
272
272
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lad-tech/nsc-toolkit",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "Toolkit for create microservices around NATS",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/types/index.d.ts",