@yolo-croket-dev/core 1.7.0 → 1.7.2

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.
@@ -5,6 +5,7 @@ interface GracefulExecInterceptor {
5
5
  correlationId: string;
6
6
  }
7
7
  export declare class GracefulShutdownService implements OnApplicationShutdown, OnModuleDestroy, OnApplicationBootstrap {
8
+ private isExecLocal?;
8
9
  private activeInterceptors;
9
10
  isApplicationExit: boolean;
10
11
  onApplicationBootstrap(): void;
@@ -40,6 +40,15 @@ let GracefulShutdownService = class GracefulShutdownService {
40
40
  }
41
41
  onApplicationBootstrap() {
42
42
  this.activeInterceptors = [];
43
+ const { ENV, ACTIVE_MSA_FLUENT_HOST, ACTIVE_MSA_FLUENT_PORT } = process.env;
44
+ if (ENV === 'local'
45
+ || (!ACTIVE_MSA_FLUENT_HOST || !ACTIVE_MSA_FLUENT_HOST.length)
46
+ || (!ACTIVE_MSA_FLUENT_PORT || !ACTIVE_MSA_FLUENT_PORT.length)) {
47
+ this.isExecLocal = true;
48
+ }
49
+ else {
50
+ this.isExecLocal = false;
51
+ }
43
52
  }
44
53
  pushActiveInterceptors(execInterceptor) {
45
54
  this.activeInterceptors.push(execInterceptor);
@@ -55,6 +64,10 @@ let GracefulShutdownService = class GracefulShutdownService {
55
64
  async onModuleDestroy() {
56
65
  this.isApplicationExit = true;
57
66
  msaLogger.debug('GracefulShutdownService.onModuleDestroy', { traceId: 'ON_MODULE_DESTROY' });
67
+ if (this.isExecLocal) {
68
+ msaLogger.debug('GracefulShutdownService.onModuleDestroy isExecLocal=true, process exit', { traceId: 'ON_MODULE_DESTROY' });
69
+ return;
70
+ }
58
71
  // eslint-disable-next-line max-len
59
72
  msaLogger.debug('GracefulShutdownService.onModuleDestroy activeInterceptors', { traceId: 'ON_MODULE_DESTROY' }, { activeInterceptors: this.activeInterceptors });
60
73
  let prevExecInterceptorCount = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yolo-croket-dev/core",
3
- "version": "1.7.0",
3
+ "version": "1.7.2",
4
4
  "author": "Yolo Co., Ltd.",
5
5
  "description": "Yolo commonization module",
6
6
  "main": "index.js",