@yolo-croket-dev/core 1.7.25-slowquery.23 → 1.7.25-slowquery.25
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.
|
@@ -170,6 +170,19 @@ let RPCInterceptor = class RPCInterceptor {
|
|
|
170
170
|
isMessageAck: false,
|
|
171
171
|
};
|
|
172
172
|
const abortController = new AbortController();
|
|
173
|
+
// eslint-disable-next-line no-undef
|
|
174
|
+
let abortCheckInterval = null;
|
|
175
|
+
abortCheckInterval = setInterval(() => {
|
|
176
|
+
try {
|
|
177
|
+
(0, functions_1.throwIfAborted)();
|
|
178
|
+
}
|
|
179
|
+
catch (err) {
|
|
180
|
+
if (abortCheckInterval) {
|
|
181
|
+
clearInterval(abortCheckInterval);
|
|
182
|
+
}
|
|
183
|
+
throw err;
|
|
184
|
+
}
|
|
185
|
+
}, 1000);
|
|
173
186
|
/** consume 메시지 전부 cancel */
|
|
174
187
|
if (this.gracefulShutdownService.isApplicationExit) {
|
|
175
188
|
msaLogger.debug('RPCInterceptor isApplicationExit called', { traceId: 'IS_APPLICATION_EXIT' });
|
|
@@ -310,12 +323,15 @@ let RPCInterceptor = class RPCInterceptor {
|
|
|
310
323
|
});
|
|
311
324
|
// abort된 경우와 일반 에러를 구분
|
|
312
325
|
if (abortController.signal.aborted) {
|
|
326
|
+
// 추가되어야 하는가?
|
|
313
327
|
return (0, rxjs_1.throwError)(() => new Error(`REQUEST_ABORTED: ${this.DEFAULT_TIMEOUT_MESSAGE}`));
|
|
314
328
|
}
|
|
315
|
-
|
|
316
|
-
return next.handle();
|
|
329
|
+
return (0, rxjs_1.throwError)(() => error);
|
|
317
330
|
}), (0, operators_1.tap)({
|
|
318
331
|
next: async (val) => {
|
|
332
|
+
if (abortCheckInterval) {
|
|
333
|
+
clearInterval(abortCheckInterval);
|
|
334
|
+
}
|
|
319
335
|
val.isError = false;
|
|
320
336
|
// const duration = Date.now() - now;
|
|
321
337
|
// logger.debug(`<= (success:${traceId}): ${val.message}`, {
|
|
@@ -338,6 +354,9 @@ let RPCInterceptor = class RPCInterceptor {
|
|
|
338
354
|
}),
|
|
339
355
|
// eslint-disable-next-line consistent-return
|
|
340
356
|
(0, operators_1.catchError)(async (err) => {
|
|
357
|
+
if (abortCheckInterval) {
|
|
358
|
+
clearInterval(abortCheckInterval);
|
|
359
|
+
}
|
|
341
360
|
// timeout 에러 처리
|
|
342
361
|
console.log('RPCInterceptor catchError 발생', err);
|
|
343
362
|
const isTimeoutError = err instanceof Error && (err.name === 'TimeoutError' || err.message === this.DEFAULT_TIMEOUT_MESSAGE);
|