@yolo-croket-dev/core 1.7.45-slowquery.2 → 1.7.45

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.
@@ -16,7 +16,7 @@ export declare class AbortContext {
16
16
  requestId: string;
17
17
  } | null;
18
18
  static disable(): void;
19
- static endContext(_context?: RequestContext): void;
19
+ static endContext(): void;
20
20
  static updateContext(updatedData: Partial<RequestContext>): void;
21
21
  /**
22
22
  * 컨텍스트가 유효한지 확인
@@ -39,7 +39,7 @@ class AbortContext {
39
39
  // AsyncLocalStorage는 각 async 작업의 컨텍스트를 자동으로 관리하므로
40
40
  // 명시적으로 disable()을 호출할 필요가 없습니다.
41
41
  // disable()을 호출하면 전체 인스턴스가 비활성화되어 이후 요청에 문제가 생깁니다.
42
- static endContext(_context) {
42
+ static endContext() {
43
43
  // 컨텍스트는 async 작업이 완료되면 자동으로 정리됩니다.
44
44
  // 명시적인 cleanup은 필요하지 않습니다.
45
45
  }
@@ -170,7 +170,7 @@ let RPCInterceptor = class RPCInterceptor {
170
170
  isMessageAck: false,
171
171
  };
172
172
  context_promise_patch_1.ContextPromisePatch.patch();
173
- const abortController = new AbortController();
173
+ let abortController = new AbortController();
174
174
  /** consume 메시지 전부 cancel */
175
175
  if (this.gracefulShutdownService.isApplicationExit) {
176
176
  msaLogger.debug('RPCInterceptor isApplicationExit called', { traceId: 'IS_APPLICATION_EXIT' });
@@ -325,49 +325,46 @@ let RPCInterceptor = class RPCInterceptor {
325
325
  }
326
326
  this.gracefulShutdownService.pushActiveInterceptors(execInterceptor);
327
327
  // eslint-disable-next-line consistent-return
328
- return functions_1.AbortContext.run(abortController.signal, execInterceptor.traceId, () => {
329
- const context = functions_1.AbortContext.getCurrentContext();
330
- return next
331
- .handle()
332
- .pipe((0, operators_1.timeout)({
333
- each: this.DEFAULT_TIMEOUT,
334
- with: () => {
335
- msaLogger.error('RPCInterceptor timeout 발생', { traceId: execInterceptor.traceId }, {
336
- message: this.DEFAULT_TIMEOUT_MESSAGE,
337
- messagePattern: method,
338
- durationMs: Date.now() - now,
339
- reDeliveryCount,
340
- staticRetryCount,
341
- });
342
- abortController.abort();
343
- return (0, rxjs_1.throwError)(() => new exceptions_1.InternalServerError('TIMEOUT_ERROR', this.DEFAULT_TIMEOUT_MESSAGE));
344
- },
345
- }), (0, operators_1.tap)({
346
- next: async (val) => {
347
- val.isError = false;
348
- /** 만약 응답데이터중 isRequeue가 true라면, 다시 재처리 하도록 함 */
349
- if (val.data && val.data.isRequeue) {
350
- channel.nack(message, false, true);
351
- execInterceptor.isMessageAck = true;
352
- return;
353
- }
354
- if (!noAck) {
355
- execInterceptor.isMessageAck = true;
356
- channel.ack(message);
357
- }
358
- },
359
- error: localErrorProcessor,
360
- }), (0, operators_1.finalize)(() => {
361
- this.gracefulShutdownService.popActiveInterceptors(execInterceptor);
362
- const isAborted = abortController === null || abortController === void 0 ? void 0 : abortController.signal.aborted;
363
- if (context) {
364
- if (isAborted) {
365
- msaLogger.debug('RPCInterceptor context end', { traceId: execInterceptor.traceId }, { context: context.requestId });
366
- }
328
+ return functions_1.AbortContext.run(abortController.signal, execInterceptor.traceId, () => next
329
+ .handle()
330
+ .pipe((0, operators_1.timeout)({
331
+ each: this.DEFAULT_TIMEOUT,
332
+ with: () => {
333
+ msaLogger.error('RPCInterceptor timeout 발생', { traceId: execInterceptor.traceId }, {
334
+ message: this.DEFAULT_TIMEOUT_MESSAGE,
335
+ messagePattern: method,
336
+ durationMs: Date.now() - now,
337
+ reDeliveryCount,
338
+ staticRetryCount,
339
+ });
340
+ abortController.abort();
341
+ return (0, rxjs_1.throwError)(() => new exceptions_1.InternalServerError('TIMEOUT_ERROR', this.DEFAULT_TIMEOUT_MESSAGE));
342
+ },
343
+ }), (0, operators_1.tap)({
344
+ next: async (val) => {
345
+ val.isError = false;
346
+ /** 만약 응답데이터중 isRequeue가 true라면, 다시 재처리 하도록 함 */
347
+ if (val.data && val.data.isRequeue) {
348
+ channel.nack(message, false, true);
349
+ execInterceptor.isMessageAck = true;
350
+ return;
367
351
  }
368
- return rxjs_1.EMPTY;
369
- }));
370
- });
352
+ if (!noAck) {
353
+ execInterceptor.isMessageAck = true;
354
+ channel.ack(message);
355
+ }
356
+ },
357
+ error: localErrorProcessor,
358
+ }), (0, operators_1.finalize)(() => {
359
+ this.gracefulShutdownService.popActiveInterceptors(execInterceptor);
360
+ const isAborted = abortController === null || abortController === void 0 ? void 0 : abortController.signal.aborted;
361
+ if (isAborted) {
362
+ msaLogger.debug('RPCInterceptor context end', { traceId: execInterceptor.traceId }, { isAborted });
363
+ functions_1.AbortContext.endContext();
364
+ abortController = null;
365
+ }
366
+ return rxjs_1.EMPTY;
367
+ })));
371
368
  }
372
369
  };
373
370
  exports.RPCInterceptor = RPCInterceptor;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yolo-croket-dev/core",
3
- "version": "1.7.45-slowquery.2",
3
+ "version": "1.7.45",
4
4
  "author": "Yolo Co., Ltd.",
5
5
  "description": "Yolo commonization module",
6
6
  "main": "index.js",