@yolo-croket-dev/core 1.7.6-jun.0 → 1.7.6-slowquery.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(
|
|
49
|
+
throw new HttpExceptionCustom('해당 메시지 패턴은 존재하지 않습니다.', 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
|
});
|
|
@@ -211,6 +211,9 @@ 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));
|
|
214
217
|
channel.nack(message, false, true);
|
|
215
218
|
message.properties.replyTo = undefined; /** replyTo가 존재하면 sendToQueue가 호출되므로, 삭제해주기 */
|
|
216
219
|
isAck = true;
|
|
@@ -279,7 +282,9 @@ let RPCInterceptor = class RPCInterceptor {
|
|
|
279
282
|
// eslint-disable-next-line consistent-return
|
|
280
283
|
return next
|
|
281
284
|
.handle()
|
|
282
|
-
.pipe(
|
|
285
|
+
.pipe(
|
|
286
|
+
// timeout(1000 * 60 * 29), // 30분 타임아웃
|
|
287
|
+
(0, operators_1.timeout)(1000 * 15), // 30분 타임아웃
|
|
283
288
|
(0, operators_1.tap)({
|
|
284
289
|
next: async (val) => {
|
|
285
290
|
val.isError = false;
|
|
@@ -8,7 +8,6 @@ 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;
|
|
12
11
|
onApplicationBootstrap(): void;
|
|
13
12
|
pushActiveInterceptors(execInterceptor: GracefulExecInterceptor): void;
|
|
14
13
|
popActiveInterceptors(execInterceptor: GracefulExecInterceptor): void;
|
|
@@ -32,13 +32,11 @@ 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");
|
|
36
35
|
const msaLogger = new msa_logger_1.default(msa_logger_1.ServerTypeEnum.SERVICE);
|
|
37
36
|
let GracefulShutdownService = class GracefulShutdownService {
|
|
38
37
|
constructor() {
|
|
39
38
|
this.activeInterceptors = [];
|
|
40
39
|
this.isApplicationExit = false;
|
|
41
|
-
this.HEALTHY_FILE_PATH = '/tmp/healthy';
|
|
42
40
|
}
|
|
43
41
|
onApplicationBootstrap() {
|
|
44
42
|
this.activeInterceptors = [];
|
|
@@ -51,10 +49,6 @@ let GracefulShutdownService = class GracefulShutdownService {
|
|
|
51
49
|
else {
|
|
52
50
|
this.isExecLocal = false;
|
|
53
51
|
}
|
|
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 });
|
|
58
52
|
}
|
|
59
53
|
pushActiveInterceptors(execInterceptor) {
|
|
60
54
|
this.activeInterceptors.push(execInterceptor);
|