@yolo-croket-dev/core 1.7.25-slowquery.11 → 1.7.25-slowquery.12
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.
|
@@ -44,6 +44,7 @@ const rxjs_1 = require("rxjs");
|
|
|
44
44
|
const operators_1 = require("rxjs/operators");
|
|
45
45
|
const msa_logger_1 = __importStar(require("@yolo-croket-dev/msa-logger"));
|
|
46
46
|
const amqplib_1 = __importDefault(require("amqplib"));
|
|
47
|
+
const abortable_promise_1 = require("@xuchaoqian/abortable-promise");
|
|
47
48
|
// import Logger from '@yolo-croket-dev/logger';
|
|
48
49
|
const functions_1 = require("../functions");
|
|
49
50
|
const exceptions_1 = require("../exceptions");
|
|
@@ -179,7 +180,15 @@ let RPCInterceptor = class RPCInterceptor {
|
|
|
179
180
|
const arg = args[0];
|
|
180
181
|
const rmq = args[1];
|
|
181
182
|
// 메시지에서 AbortController 가져오기
|
|
182
|
-
const abortController = rmq.args[0].abortController;
|
|
183
|
+
// const abortController = (rmq as any).args[0].abortController;
|
|
184
|
+
const abortController = new AbortController();
|
|
185
|
+
const handler = context.getHandler();
|
|
186
|
+
console.log('args: ', args);
|
|
187
|
+
console.log('context: ', context);
|
|
188
|
+
const abortablePromise = new abortable_promise_1.AbortablePromise((...args) => handler(...args), abortController.signal);
|
|
189
|
+
context.handler = abortablePromise;
|
|
190
|
+
console.log('handler: ', handler);
|
|
191
|
+
console.log('context: ', context);
|
|
183
192
|
// const messageId = (rmq as any).messageId;
|
|
184
193
|
// if (!abortController) {
|
|
185
194
|
// // AbortController가 없으면 기본 처리
|
|
@@ -346,11 +355,10 @@ let RPCInterceptor = class RPCInterceptor {
|
|
|
346
355
|
// logger.debug(`=> (${traceId}): ${JSON.stringify(this.keyCutter(JSON.stringify(content)))}`);
|
|
347
356
|
}
|
|
348
357
|
this.gracefulShutdownService.pushActiveInterceptors(execInterceptor);
|
|
349
|
-
const abort$ = (0, rxjs_1.fromEvent)(abortController.signal, 'abort');
|
|
350
358
|
// eslint-disable-next-line consistent-return
|
|
351
359
|
return next
|
|
352
360
|
.handle()
|
|
353
|
-
.pipe(
|
|
361
|
+
.pipe(
|
|
354
362
|
// timeout(1000 * 60 * 29), // 30분 타임아웃
|
|
355
363
|
(0, operators_1.timeout)(1000 * 3), // 30분 타임아웃
|
|
356
364
|
(0, operators_1.tap)({
|