@yolo-croket-dev/core 1.7.25-slowquery.10 → 1.7.25-slowquery.11

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.
@@ -346,23 +346,11 @@ let RPCInterceptor = class RPCInterceptor {
346
346
  // logger.debug(`=> (${traceId}): ${JSON.stringify(this.keyCutter(JSON.stringify(content)))}`);
347
347
  }
348
348
  this.gracefulShutdownService.pushActiveInterceptors(execInterceptor);
349
+ const abort$ = (0, rxjs_1.fromEvent)(abortController.signal, 'abort');
349
350
  // eslint-disable-next-line consistent-return
350
351
  return next
351
352
  .handle()
352
- .pipe((0, operators_1.switchMap)((val) => {
353
- console.log('switchMap called', val);
354
- if (abortController === null || abortController === void 0 ? void 0 : abortController.signal.aborted) {
355
- console.log('RPC Interceptor: Service execution aborted');
356
- return (0, rxjs_1.throwError)(() => new Error('Service execution aborted'));
357
- }
358
- // // AbortController를 컨텍스트에 주입
359
- // const request = context.switchToRpc().getData();
360
- // if (request && typeof request === 'object') {
361
- // (request as any).abortController = abortController;
362
- // (request as any).abortSignal = abortController?.signal;
363
- // }
364
- return (0, rxjs_1.of)(val);
365
- }),
353
+ .pipe((0, operators_1.takeUntil)(abort$),
366
354
  // timeout(1000 * 60 * 29), // 30분 타임아웃
367
355
  (0, operators_1.timeout)(1000 * 3), // 30분 타임아웃
368
356
  (0, operators_1.tap)({
@@ -395,7 +383,6 @@ let RPCInterceptor = class RPCInterceptor {
395
383
  if (isTimeoutError) {
396
384
  if (abortController) {
397
385
  abortController.abort();
398
- throw new Error('Message aborted due to timeout');
399
386
  }
400
387
  msaLogger.error('[타임 아웃] 메시지 재전송 처리', { traceId: execInterceptor.traceId }, {
401
388
  error: {
@@ -69,7 +69,12 @@ class GracefulServerRMQ extends microservices_1.ServerRMQ {
69
69
  reject(err);
70
70
  }
71
71
  }, abortController.signal);
72
- await abortablePromise;
72
+ abortablePromise.then((val) => {
73
+ console.log('handleMessage success', val);
74
+ }).catch((err) => {
75
+ console.log('handleMessage error', err);
76
+ throw err;
77
+ });
73
78
  }
74
79
  catch (error) {
75
80
  if (error.message.includes('Message aborted')) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yolo-croket-dev/core",
3
- "version": "1.7.25-slowquery.10",
3
+ "version": "1.7.25-slowquery.11",
4
4
  "author": "Yolo Co., Ltd.",
5
5
  "description": "Yolo commonization module",
6
6
  "main": "index.js",