@yolo-croket-dev/core 1.7.25-slowquery.30 → 1.7.25-slowquery.31

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.
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AbortEvent = void 0;
4
4
  // src/modules/rpc-testing/decorators/abort-event.decorator.ts
5
5
  const abort_1 = require("../functions/abort");
6
+ const abortable_promise_1 = require("@xuchaoqian/abortable-promise");
6
7
  /**
7
8
  * 이벤트 기반으로 AbortSignal을 감지하는 데코레이터 (Interval 없음)
8
9
  */
@@ -11,17 +12,11 @@ function AbortEvent() {
11
12
  const originalMethod = descriptor.value;
12
13
  // eslint-disable-next-line no-param-reassign
13
14
  descriptor.value = async function (...args) {
14
- // 중단 확인을 위한 인터벌
15
- const intervalId = setInterval(() => {
16
- (0, abort_1.throwIfAborted)();
17
- }, 100);
18
15
  try {
19
- const result = await originalMethod.apply(this, args);
20
- clearInterval(intervalId);
16
+ const result = await new abortable_promise_1.AbortablePromise(originalMethod.apply(this, args), (0, abort_1.getCurrentAbortSignal)() || undefined);
21
17
  return result;
22
18
  }
23
19
  catch (error) {
24
- clearInterval(intervalId);
25
20
  throw error;
26
21
  }
27
22
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yolo-croket-dev/core",
3
- "version": "1.7.25-slowquery.30",
3
+ "version": "1.7.25-slowquery.31",
4
4
  "author": "Yolo Co., Ltd.",
5
5
  "description": "Yolo commonization module",
6
6
  "main": "index.js",
@@ -15,6 +15,7 @@
15
15
  "license": "UNLICENSED",
16
16
  "dependencies": {
17
17
  "@nestjs/common": "^8.2.3",
18
+ "@xuchaoqian/abortable-promise": "^1.11.2",
18
19
  "@yolo-croket-dev/logger": "^1.0.15",
19
20
  "@yolo-croket-dev/msa-logger": "^3.0.4",
20
21
  "@yolo-croket-dev/redis": "^1.0.23",
@@ -26,7 +27,7 @@
26
27
  "uuid": "^8.3.2"
27
28
  },
28
29
  "devDependencies": {
29
- "@types/node": "^16.11.9",
30
+ "@types/node": "^24.3.1",
30
31
  "@types/randomstring": "^1.1.8",
31
32
  "@types/uuid": "^8.3.4"
32
33
  }