@yolo-croket-dev/core 1.7.11 → 1.7.12-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.
- package/interceptors/logging-service.interceptor.js +2 -2
- package/interceptors/rpc.interceptor.js +6 -14
- 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.js +2 -2
- package/modules/redis.module.js +2 -2
- package/package.json +1 -1
- package/pipes/rpc-validation.pipe.js +2 -2
|
@@ -188,7 +188,7 @@ let LoggingServiceInterceptor = class LoggingServiceInterceptor {
|
|
|
188
188
|
}));
|
|
189
189
|
}
|
|
190
190
|
};
|
|
191
|
-
|
|
192
|
-
exports.LoggingServiceInterceptor = LoggingServiceInterceptor = __decorate([
|
|
191
|
+
LoggingServiceInterceptor = __decorate([
|
|
193
192
|
(0, common_1.Injectable)()
|
|
194
193
|
], LoggingServiceInterceptor);
|
|
194
|
+
exports.LoggingServiceInterceptor = LoggingServiceInterceptor;
|
|
@@ -135,7 +135,7 @@ let RPCInterceptor = class RPCInterceptor {
|
|
|
135
135
|
// return data;
|
|
136
136
|
// }
|
|
137
137
|
async intercept(context, next) {
|
|
138
|
-
var _a, _b, _c
|
|
138
|
+
var _a, _b, _c;
|
|
139
139
|
const options = this.reflector.get('rpcInterceptorScope', context.getHandler());
|
|
140
140
|
const args = context.getArgs();
|
|
141
141
|
const arg = args[0];
|
|
@@ -149,7 +149,6 @@ let RPCInterceptor = class RPCInterceptor {
|
|
|
149
149
|
const isAdmin = content.data.param ? content.data.param.isAdmin : false;
|
|
150
150
|
const reDeliveryCount = Number(message.properties.headers['x-delivery-count']) || 0; /** 몇번 재전달되었는지 */
|
|
151
151
|
const staticRetryCount = Number(options === null || options === void 0 ? void 0 : options.messageRetryCount) || 0; /** 최대 재시도 갯수 */
|
|
152
|
-
const isRedelivery = message.fields.redelivered;
|
|
153
152
|
const method = content.pattern;
|
|
154
153
|
const correlationId = message.properties.correlationId;
|
|
155
154
|
const execInterceptor = {
|
|
@@ -172,7 +171,6 @@ let RPCInterceptor = class RPCInterceptor {
|
|
|
172
171
|
properties: message.properties,
|
|
173
172
|
fields: message.fields,
|
|
174
173
|
time: Date.now(),
|
|
175
|
-
isRedelivery,
|
|
176
174
|
reDeliveryCount,
|
|
177
175
|
staticRetryCount,
|
|
178
176
|
});
|
|
@@ -188,14 +186,6 @@ let RPCInterceptor = class RPCInterceptor {
|
|
|
188
186
|
message.properties.replyTo = undefined; /** replyTo가 존재하면 sendToQueue가 호출되므로, 삭제해주기 */
|
|
189
187
|
return new rxjs_1.Observable();
|
|
190
188
|
}
|
|
191
|
-
msaLogger.debug('RETRY_COUNT_ZERO_OR_NO_RETRY debug isNotRedelivery', { traceId: ((_c = content.data.param) === null || _c === void 0 ? void 0 : _c.traceId) || 'RETRY_COUNT_ZERO_OR_NO_RETRY' }, {
|
|
192
|
-
properties: message.properties,
|
|
193
|
-
fields: message.fields,
|
|
194
|
-
time: Date.now(),
|
|
195
|
-
isRedelivery,
|
|
196
|
-
reDeliveryCount,
|
|
197
|
-
staticRetryCount,
|
|
198
|
-
});
|
|
199
189
|
const noAck = message.fields.routingKey.includes('ASYNC');
|
|
200
190
|
let localErrorProcessor = async (err) => {
|
|
201
191
|
var _a;
|
|
@@ -228,6 +218,7 @@ let RPCInterceptor = class RPCInterceptor {
|
|
|
228
218
|
&& err.isRetry !== false) {
|
|
229
219
|
/** 재시도 로직이 필요한 경우, 0보다 커야 정의된것. 기본값이 0, isRetry값이 false로 정의된 에러가 아니라면 전부 재시도 */
|
|
230
220
|
if (reDeliveryCount <= (staticRetryCount - 1)) { /** 재시도 횟수가 있고, 재시도 횟수보다 적을 경우, 0부터 카운팅 되므로 -1 */
|
|
221
|
+
message.properties.headers['x-requeue-reason'] = 'RETRY';
|
|
231
222
|
channel.nack(message, false, true);
|
|
232
223
|
message.properties.replyTo = undefined; /** replyTo가 존재하면 sendToQueue가 호출되므로, 삭제해주기 */
|
|
233
224
|
isAck = true;
|
|
@@ -235,6 +226,7 @@ let RPCInterceptor = class RPCInterceptor {
|
|
|
235
226
|
else {
|
|
236
227
|
const dlqMessage = JSON.stringify(abstractAmqpHandlerData);
|
|
237
228
|
channel.sendToQueue(message.properties.replyTo, Buffer.from(dlqMessage), { correlationId: message.properties.correlationId });
|
|
229
|
+
message.properties.headers['x-requeue-reason'] = 'DLQ-FORWARD';
|
|
238
230
|
channel.nack(message, false, false); /** 최대 진행 횟수가 넘어간다면 DLQ로 전달 */
|
|
239
231
|
}
|
|
240
232
|
isAck = true;
|
|
@@ -263,7 +255,7 @@ let RPCInterceptor = class RPCInterceptor {
|
|
|
263
255
|
};
|
|
264
256
|
localErrorProcessor = localErrorProcessor.bind(this);
|
|
265
257
|
/** 파일 객체 처리 */
|
|
266
|
-
(0, functions_1.reWriteFileValue)((
|
|
258
|
+
(0, functions_1.reWriteFileValue)((_c = content === null || content === void 0 ? void 0 : content.data) === null || _c === void 0 ? void 0 : _c.file);
|
|
267
259
|
if (options) {
|
|
268
260
|
if (options.maxLengthKeys && options.maxLengthKeys.length) {
|
|
269
261
|
for (const key of options.maxLengthKeys) {
|
|
@@ -321,9 +313,9 @@ let RPCInterceptor = class RPCInterceptor {
|
|
|
321
313
|
}));
|
|
322
314
|
}
|
|
323
315
|
};
|
|
324
|
-
|
|
325
|
-
exports.RPCInterceptor = RPCInterceptor = __decorate([
|
|
316
|
+
RPCInterceptor = __decorate([
|
|
326
317
|
(0, common_1.Injectable)(),
|
|
327
318
|
__metadata("design:paramtypes", [core_1.Reflector,
|
|
328
319
|
graceful_shutdown_service_1.GracefulShutdownService])
|
|
329
320
|
], RPCInterceptor);
|
|
321
|
+
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
|
};
|
|
@@ -94,7 +94,7 @@ let GracefulShutdownService = class GracefulShutdownService {
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
|
-
|
|
98
|
-
exports.GracefulShutdownService = GracefulShutdownService = __decorate([
|
|
97
|
+
GracefulShutdownService = __decorate([
|
|
99
98
|
(0, common_1.Injectable)()
|
|
100
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;
|