@yolo-croket-dev/core 1.7.6-slowquery.0 → 1.7.6-slowquery.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.
- package/interceptors/logging-service.interceptor.js +2 -2
- package/interceptors/rpc.interceptor.js +3 -8
- 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
|
@@ -180,7 +180,7 @@ let LoggingServiceInterceptor = class LoggingServiceInterceptor {
|
|
|
180
180
|
}));
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
|
-
|
|
184
|
-
exports.LoggingServiceInterceptor = LoggingServiceInterceptor = __decorate([
|
|
183
|
+
LoggingServiceInterceptor = __decorate([
|
|
185
184
|
(0, common_1.Injectable)()
|
|
186
185
|
], LoggingServiceInterceptor);
|
|
186
|
+
exports.LoggingServiceInterceptor = LoggingServiceInterceptor;
|
|
@@ -211,9 +211,6 @@ let RPCInterceptor = class RPCInterceptor {
|
|
|
211
211
|
&& err.isRetry !== false) {
|
|
212
212
|
/** 재시도 로직이 필요한 경우, 0보다 커야 정의된것. 기본값이 0, isRetry값이 false로 정의된 에러가 아니라면 전부 재시도 */
|
|
213
213
|
if (reDeliveryCount <= (staticRetryCount - 1)) { /** 재시도 횟수가 있고, 재시도 횟수보다 적을 경우, 0부터 카운팅 되므로 -1 */
|
|
214
|
-
const newContent = content;
|
|
215
|
-
newContent.data.param.retryCount = reDeliveryCount + 1;
|
|
216
|
-
message.content = Buffer.from(JSON.stringify(newContent));
|
|
217
214
|
channel.nack(message, false, true);
|
|
218
215
|
message.properties.replyTo = undefined; /** replyTo가 존재하면 sendToQueue가 호출되므로, 삭제해주기 */
|
|
219
216
|
isAck = true;
|
|
@@ -282,9 +279,7 @@ let RPCInterceptor = class RPCInterceptor {
|
|
|
282
279
|
// eslint-disable-next-line consistent-return
|
|
283
280
|
return next
|
|
284
281
|
.handle()
|
|
285
|
-
.pipe(
|
|
286
|
-
// timeout(1000 * 60 * 29), // 30분 타임아웃
|
|
287
|
-
(0, operators_1.timeout)(1000 * 15), // 30분 타임아웃
|
|
282
|
+
.pipe((0, operators_1.timeout)(1000 * 60 * 29), // 30분 타임아웃
|
|
288
283
|
(0, operators_1.tap)({
|
|
289
284
|
next: async (val) => {
|
|
290
285
|
val.isError = false;
|
|
@@ -309,9 +304,9 @@ let RPCInterceptor = class RPCInterceptor {
|
|
|
309
304
|
}));
|
|
310
305
|
}
|
|
311
306
|
};
|
|
312
|
-
|
|
313
|
-
exports.RPCInterceptor = RPCInterceptor = __decorate([
|
|
307
|
+
RPCInterceptor = __decorate([
|
|
314
308
|
(0, common_1.Injectable)(),
|
|
315
309
|
__metadata("design:paramtypes", [core_1.Reflector,
|
|
316
310
|
graceful_shutdown_service_1.GracefulShutdownService])
|
|
317
311
|
], RPCInterceptor);
|
|
312
|
+
exports.RPCInterceptor = RPCInterceptor;
|
package/interfaces/exception.js
CHANGED
|
@@ -18,10 +18,9 @@ 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 || (exports.ErrActionTypeEnum = {}));
|
|
22
22
|
class ErrAction {
|
|
23
23
|
}
|
|
24
|
-
exports.ErrAction = ErrAction;
|
|
25
24
|
__decorate([
|
|
26
25
|
(0, swagger_1.ApiProperty)({
|
|
27
26
|
description: '액션 타입',
|
|
@@ -58,9 +57,9 @@ __decorate([
|
|
|
58
57
|
}),
|
|
59
58
|
__metadata("design:type", String)
|
|
60
59
|
], ErrAction.prototype, "webViewUrl", void 0);
|
|
60
|
+
exports.ErrAction = ErrAction;
|
|
61
61
|
class ErrInfo {
|
|
62
62
|
}
|
|
63
|
-
exports.ErrInfo = ErrInfo;
|
|
64
63
|
__decorate([
|
|
65
64
|
(0, swagger_1.ApiProperty)({
|
|
66
65
|
description: '에러 종류 식별자',
|
|
@@ -82,3 +81,4 @@ __decorate([
|
|
|
82
81
|
}),
|
|
83
82
|
__metadata("design:type", ErrAction)
|
|
84
83
|
], 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
|
-
|
|
15
|
-
exports.GracefulShutdownModule = GracefulShutdownModule = __decorate([
|
|
14
|
+
GracefulShutdownModule = __decorate([
|
|
16
15
|
(0, common_1.Global)(),
|
|
17
16
|
(0, common_1.Module)({
|
|
18
17
|
providers: [graceful_shutdown_service_1.GracefulShutdownService],
|
|
19
18
|
exports: [graceful_shutdown_service_1.GracefulShutdownService],
|
|
20
19
|
})
|
|
21
20
|
], 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 type GracefulRmqOptions = RmqOptions['options'] & {
|
|
4
|
+
export declare 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
|
-
|
|
92
|
-
exports.GracefulShutdownService = GracefulShutdownService = __decorate([
|
|
97
|
+
GracefulShutdownService = __decorate([
|
|
93
98
|
(0, common_1.Injectable)()
|
|
94
99
|
], GracefulShutdownService);
|
|
100
|
+
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
|
-
|
|
19
|
-
exports.RedisModule = RedisModule = __decorate([
|
|
18
|
+
RedisModule = __decorate([
|
|
20
19
|
(0, common_1.Module)({
|
|
21
20
|
providers: [redisProvider],
|
|
22
21
|
exports: [redisProvider],
|
|
23
22
|
})
|
|
24
23
|
], 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
|
-
|
|
35
|
-
exports.ValidationPipe = ValidationPipe = __decorate([
|
|
34
|
+
ValidationPipe = __decorate([
|
|
36
35
|
(0, common_1.Injectable)(),
|
|
37
36
|
__metadata("design:paramtypes", [Object])
|
|
38
37
|
], ValidationPipe);
|
|
38
|
+
exports.ValidationPipe = ValidationPipe;
|