@yolo-croket-dev/core 1.7.5 → 1.7.6-jun.1
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.
- package/functions/amqp-handler.function.js +3 -1
- package/interceptors/logging-service.interceptor.js +2 -2
- package/interceptors/rpc.interceptor.js +2 -2
- package/interfaces/exception.js +3 -3
- package/modules/graceful-shutdown/graceful-shutdown.module.js +2 -2
- package/modules/graceful-shutdown/graceful-shutdown.rmq.d.ts +1 -1
- package/modules/graceful-shutdown/graceful-shutdown.service.d.ts +1 -0
- package/modules/graceful-shutdown/graceful-shutdown.service.js +8 -2
- package/modules/redis.module.js +2 -2
- package/package.json +1 -1
- package/pipes/rpc-validation.pipe.js +2 -2
|
@@ -46,7 +46,9 @@ 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
|
-
|
|
49
|
+
console.log('@@@@@@@@@@@@@@@@@@@@@@@@@ 어서 오세요.');
|
|
50
|
+
console.log('@@@@@@@@@@@@@@@@@@@@@@@@@ 어서 오세요.', messagePattern);
|
|
51
|
+
throw new HttpExceptionCustom(`${messagePattern} 해당 메시지 패턴은 존재하지 않습니다.`, 404, 'There is no matching message handler defined in the remote service.', {
|
|
50
52
|
type: 'NOT_EXISTS_MESSAGE_PATTERN',
|
|
51
53
|
message: `${messagePattern} 해당 메시지 패턴은 존재하지 않습니다.`,
|
|
52
54
|
});
|
|
@@ -180,7 +180,7 @@ let LoggingServiceInterceptor = class LoggingServiceInterceptor {
|
|
|
180
180
|
}));
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
|
-
LoggingServiceInterceptor =
|
|
183
|
+
exports.LoggingServiceInterceptor = LoggingServiceInterceptor;
|
|
184
|
+
exports.LoggingServiceInterceptor = LoggingServiceInterceptor = __decorate([
|
|
184
185
|
(0, common_1.Injectable)()
|
|
185
186
|
], LoggingServiceInterceptor);
|
|
186
|
-
exports.LoggingServiceInterceptor = LoggingServiceInterceptor;
|
|
@@ -304,9 +304,9 @@ let RPCInterceptor = class RPCInterceptor {
|
|
|
304
304
|
}));
|
|
305
305
|
}
|
|
306
306
|
};
|
|
307
|
-
RPCInterceptor =
|
|
307
|
+
exports.RPCInterceptor = RPCInterceptor;
|
|
308
|
+
exports.RPCInterceptor = RPCInterceptor = __decorate([
|
|
308
309
|
(0, common_1.Injectable)(),
|
|
309
310
|
__metadata("design:paramtypes", [core_1.Reflector,
|
|
310
311
|
graceful_shutdown_service_1.GracefulShutdownService])
|
|
311
312
|
], RPCInterceptor);
|
|
312
|
-
exports.RPCInterceptor = RPCInterceptor;
|
package/interfaces/exception.js
CHANGED
|
@@ -18,9 +18,10 @@ var ErrActionTypeEnum;
|
|
|
18
18
|
ErrActionTypeEnum["LEGACY_SHOW_TOAST"] = "LEGACY_SHOW_TOAST";
|
|
19
19
|
ErrActionTypeEnum["FORCE_UPDATE"] = "FORCE_UPDATE";
|
|
20
20
|
ErrActionTypeEnum["UPDATE_ACCESS_TOKEN"] = "UPDATE_ACCESS_TOKEN";
|
|
21
|
-
})(ErrActionTypeEnum
|
|
21
|
+
})(ErrActionTypeEnum || (exports.ErrActionTypeEnum = ErrActionTypeEnum = {}));
|
|
22
22
|
class ErrAction {
|
|
23
23
|
}
|
|
24
|
+
exports.ErrAction = ErrAction;
|
|
24
25
|
__decorate([
|
|
25
26
|
(0, swagger_1.ApiProperty)({
|
|
26
27
|
description: '액션 타입',
|
|
@@ -57,9 +58,9 @@ __decorate([
|
|
|
57
58
|
}),
|
|
58
59
|
__metadata("design:type", String)
|
|
59
60
|
], ErrAction.prototype, "webViewUrl", void 0);
|
|
60
|
-
exports.ErrAction = ErrAction;
|
|
61
61
|
class ErrInfo {
|
|
62
62
|
}
|
|
63
|
+
exports.ErrInfo = ErrInfo;
|
|
63
64
|
__decorate([
|
|
64
65
|
(0, swagger_1.ApiProperty)({
|
|
65
66
|
description: '에러 종류 식별자',
|
|
@@ -81,4 +82,3 @@ __decorate([
|
|
|
81
82
|
}),
|
|
82
83
|
__metadata("design:type", ErrAction)
|
|
83
84
|
], ErrInfo.prototype, "action", void 0);
|
|
84
|
-
exports.ErrInfo = ErrInfo;
|
|
@@ -11,11 +11,11 @@ const common_1 = require("@nestjs/common");
|
|
|
11
11
|
const graceful_shutdown_service_1 = require("./graceful-shutdown.service");
|
|
12
12
|
let GracefulShutdownModule = class GracefulShutdownModule {
|
|
13
13
|
};
|
|
14
|
-
GracefulShutdownModule =
|
|
14
|
+
exports.GracefulShutdownModule = GracefulShutdownModule;
|
|
15
|
+
exports.GracefulShutdownModule = GracefulShutdownModule = __decorate([
|
|
15
16
|
(0, common_1.Global)(),
|
|
16
17
|
(0, common_1.Module)({
|
|
17
18
|
providers: [graceful_shutdown_service_1.GracefulShutdownService],
|
|
18
19
|
exports: [graceful_shutdown_service_1.GracefulShutdownService],
|
|
19
20
|
})
|
|
20
21
|
], GracefulShutdownModule);
|
|
21
|
-
exports.GracefulShutdownModule = GracefulShutdownModule;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RmqOptions, ServerRMQ } from '@nestjs/microservices';
|
|
2
2
|
import { Channel } from 'amqp-connection-manager';
|
|
3
3
|
import { ConsumeMessage } from 'amqplib';
|
|
4
|
-
export
|
|
4
|
+
export type GracefulRmqOptions = RmqOptions['options'] & {
|
|
5
5
|
waitingEndingHandlersTimeoutMs?: number;
|
|
6
6
|
waitingEndingHandlersIntervalMs?: number;
|
|
7
7
|
};
|
|
@@ -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);
|
|
@@ -88,7 +94,7 @@ let GracefulShutdownService = class GracefulShutdownService {
|
|
|
88
94
|
}
|
|
89
95
|
}
|
|
90
96
|
};
|
|
91
|
-
GracefulShutdownService =
|
|
97
|
+
exports.GracefulShutdownService = GracefulShutdownService;
|
|
98
|
+
exports.GracefulShutdownService = GracefulShutdownService = __decorate([
|
|
92
99
|
(0, common_1.Injectable)()
|
|
93
100
|
], GracefulShutdownService);
|
|
94
|
-
exports.GracefulShutdownService = GracefulShutdownService;
|
package/modules/redis.module.js
CHANGED
|
@@ -15,10 +15,10 @@ const redisProvider = {
|
|
|
15
15
|
};
|
|
16
16
|
let RedisModule = class RedisModule {
|
|
17
17
|
};
|
|
18
|
-
RedisModule =
|
|
18
|
+
exports.RedisModule = RedisModule;
|
|
19
|
+
exports.RedisModule = RedisModule = __decorate([
|
|
19
20
|
(0, common_1.Module)({
|
|
20
21
|
providers: [redisProvider],
|
|
21
22
|
exports: [redisProvider],
|
|
22
23
|
})
|
|
23
24
|
], RedisModule);
|
|
24
|
-
exports.RedisModule = RedisModule;
|
package/package.json
CHANGED
|
@@ -31,8 +31,8 @@ let ValidationPipe = class ValidationPipe {
|
|
|
31
31
|
return value;
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
ValidationPipe =
|
|
34
|
+
exports.ValidationPipe = ValidationPipe;
|
|
35
|
+
exports.ValidationPipe = ValidationPipe = __decorate([
|
|
35
36
|
(0, common_1.Injectable)(),
|
|
36
37
|
__metadata("design:paramtypes", [Object])
|
|
37
38
|
], ValidationPipe);
|
|
38
|
-
exports.ValidationPipe = ValidationPipe;
|