@yolo-croket-dev/core 1.7.5-slowquery.5 → 1.7.6-jun.0

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.
@@ -46,7 +46,7 @@ async function AmqpHandler(client, messagePattern, payload) {
46
46
  catch (err) {
47
47
  if (typeof err === 'string' && err.includes('There is no matching message handler defined in the remote service.')) {
48
48
  msaLogger.error('NOT_EXISTS_MESSAGE_PATTERN', { traceId: ((_b = payload === null || payload === void 0 ? void 0 : payload.param) === null || _b === void 0 ? void 0 : _b.traceId) || '-' }, { err });
49
- throw new HttpExceptionCustom('해당 메시지 패턴은 존재하지 않습니다.', 404, 'There is no matching message handler defined in the remote service.', {
49
+ throw new HttpExceptionCustom(`${messagePattern} 해당 메시지 패턴은 존재하지 않습니다.`, 404, 'There is no matching message handler defined in the remote service.', {
50
50
  type: 'NOT_EXISTS_MESSAGE_PATTERN',
51
51
  message: `${messagePattern} 해당 메시지 패턴은 존재하지 않습니다.`,
52
52
  });
@@ -279,8 +279,7 @@ let RPCInterceptor = class RPCInterceptor {
279
279
  // eslint-disable-next-line consistent-return
280
280
  return next
281
281
  .handle()
282
- .pipe((0, operators_1.timeout)(1000 * 10),
283
- // timeout(1000 * 60 * 30), // 30분 타임아웃
282
+ .pipe((0, operators_1.timeout)(1000 * 60 * 29), // 30분 타임아웃
284
283
  (0, operators_1.tap)({
285
284
  next: async (val) => {
286
285
  val.isError = false;
@@ -302,10 +301,6 @@ let RPCInterceptor = class RPCInterceptor {
302
301
  error: localErrorProcessor,
303
302
  }), (0, operators_1.finalize)(() => {
304
303
  this.gracefulShutdownService.popActiveInterceptors(execInterceptor);
305
- }), (0, operators_1.catchError)(async (err) => {
306
- console.log('err: ', err.name, err.message);
307
- channel.nack(message, false, true);
308
- console.log('nack 호출 (retry)');
309
304
  }));
310
305
  }
311
306
  };
@@ -8,6 +8,7 @@ export declare class GracefulShutdownService implements OnApplicationShutdown, O
8
8
  private isExecLocal?;
9
9
  private activeInterceptors;
10
10
  isApplicationExit: boolean;
11
+ private readonly HEALTHY_FILE_PATH;
11
12
  onApplicationBootstrap(): void;
12
13
  pushActiveInterceptors(execInterceptor: GracefulExecInterceptor): void;
13
14
  popActiveInterceptors(execInterceptor: GracefulExecInterceptor): void;
@@ -32,11 +32,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
32
32
  exports.GracefulShutdownService = void 0;
33
33
  const common_1 = require("@nestjs/common");
34
34
  const msa_logger_1 = __importStar(require("@yolo-croket-dev/msa-logger"));
35
+ const fs_1 = require("fs");
35
36
  const msaLogger = new msa_logger_1.default(msa_logger_1.ServerTypeEnum.SERVICE);
36
37
  let GracefulShutdownService = class GracefulShutdownService {
37
38
  constructor() {
38
39
  this.activeInterceptors = [];
39
40
  this.isApplicationExit = false;
41
+ this.HEALTHY_FILE_PATH = '/tmp/healthy';
40
42
  }
41
43
  onApplicationBootstrap() {
42
44
  this.activeInterceptors = [];
@@ -49,6 +51,10 @@ let GracefulShutdownService = class GracefulShutdownService {
49
51
  else {
50
52
  this.isExecLocal = false;
51
53
  }
54
+ // Health check 용 파일 생성
55
+ (0, fs_1.writeFileSync)(this.HEALTHY_FILE_PATH, (new Date().toISOString()));
56
+ const isHealthyFileExist = (0, fs_1.existsSync)(this.HEALTHY_FILE_PATH);
57
+ msaLogger.debug(`GracefulShutdownService.onApplicationBootstrap isExecLocal=${this.isExecLocal}`, { traceId: 'ON_APPLICATION_BOOTSTRAP' }, { isHealthyFileExist });
52
58
  }
53
59
  pushActiveInterceptors(execInterceptor) {
54
60
  this.activeInterceptors.push(execInterceptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yolo-croket-dev/core",
3
- "version": "1.7.5-slowquery.5",
3
+ "version": "1.7.6-jun.0",
4
4
  "author": "Yolo Co., Ltd.",
5
5
  "description": "Yolo commonization module",
6
6
  "main": "index.js",