@yolo-croket-dev/core 1.7.38-slowquery.2 → 1.7.38-slowquery.3
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.
|
@@ -26,7 +26,6 @@ class ContextPromisePatch {
|
|
|
26
26
|
const contextId = currentContext.requestId;
|
|
27
27
|
// 이미 중단된 경우
|
|
28
28
|
if (abortSignal.aborted) {
|
|
29
|
-
console.log('Promise 생성자 패치: 이미 중단된 경우');
|
|
30
29
|
return Promise.reject(new Error(`REQUEST_ABORTED: Promise가 중단되었습니다 (${contextId})`));
|
|
31
30
|
}
|
|
32
31
|
const promise = Reflect.construct(target, args);
|
|
@@ -39,7 +38,6 @@ class ContextPromisePatch {
|
|
|
39
38
|
return result;
|
|
40
39
|
}
|
|
41
40
|
if (abortSignal.aborted) {
|
|
42
|
-
console.log('Promise 생성자 패치: Promise 실행 중 중단된 경우');
|
|
43
41
|
throw new Error(`REQUEST_ABORTED: Promise 실행 중 중단되었습니다 (${contextId})`);
|
|
44
42
|
}
|
|
45
43
|
return result;
|
|
@@ -51,7 +49,6 @@ class ContextPromisePatch {
|
|
|
51
49
|
throw error;
|
|
52
50
|
}
|
|
53
51
|
if (abortSignal.aborted) {
|
|
54
|
-
console.log('Promise 생성자 패치: Promise 실행 중 중단된 경우');
|
|
55
52
|
throw new Error(`REQUEST_ABORTED: Promise 실행 중 중단되었습니다 (${contextId})`);
|
|
56
53
|
}
|
|
57
54
|
throw error;
|
|
@@ -69,7 +66,6 @@ class ContextPromisePatch {
|
|
|
69
66
|
const abortSignal = currentContext.abortSignal;
|
|
70
67
|
const contextId = currentContext.requestId;
|
|
71
68
|
if (abortSignal.aborted) {
|
|
72
|
-
console.log('Promise 생성자 패치: Promise.resolve가 중단된 경우');
|
|
73
69
|
return Promise.reject(new Error(`REQUEST_ABORTED: Promise.resolve가 중단되었습니다 (${contextId})`));
|
|
74
70
|
}
|
|
75
71
|
const promise = originalResolve.call(global.Promise, value);
|
|
@@ -79,7 +75,6 @@ class ContextPromisePatch {
|
|
|
79
75
|
return result;
|
|
80
76
|
}
|
|
81
77
|
if (abortSignal.aborted) {
|
|
82
|
-
console.log('Promise 생성자 패치: Promise.resolve 실행 중 중단된 경우');
|
|
83
78
|
throw new Error(`REQUEST_ABORTED: Promise.resolve 실행 중 중단되었습니다 (${contextId})`);
|
|
84
79
|
}
|
|
85
80
|
return result;
|
|
@@ -89,7 +84,6 @@ class ContextPromisePatch {
|
|
|
89
84
|
throw error;
|
|
90
85
|
}
|
|
91
86
|
if (abortSignal.aborted) {
|
|
92
|
-
console.log('Promise 생성자 패치: Promise.resolve 실행 중 중단된 경우');
|
|
93
87
|
throw new Error(`REQUEST_ABORTED: Promise.resolve 실행 중 중단되었습니다 (${contextId})`);
|
|
94
88
|
}
|
|
95
89
|
throw error;
|
|
@@ -105,7 +99,6 @@ class ContextPromisePatch {
|
|
|
105
99
|
}
|
|
106
100
|
const abortSignal = currentContext.abortSignal;
|
|
107
101
|
if (abortSignal.aborted) {
|
|
108
|
-
console.log('Promise 생성자 패치: Promise.reject가 중단된 경우');
|
|
109
102
|
return Promise.reject(new Error(`REQUEST_ABORTED: Promise.reject가 중단되었습니다 (${currentContext.requestId})`));
|
|
110
103
|
}
|
|
111
104
|
return originalReject.call(global.Promise, reason);
|
|
@@ -122,7 +115,6 @@ class ContextPromisePatch {
|
|
|
122
115
|
const abortSignal = currentContext.abortSignal;
|
|
123
116
|
const contextId = currentContext.requestId;
|
|
124
117
|
if (abortSignal.aborted) {
|
|
125
|
-
console.log('Promise 생성자 패치: setTimeout이 중단된 경우');
|
|
126
118
|
throw new Error(`REQUEST_ABORTED: setTimeout이 중단되었습니다 (${contextId})`);
|
|
127
119
|
}
|
|
128
120
|
const wrappedCallback = () => {
|
|
@@ -135,7 +127,6 @@ class ContextPromisePatch {
|
|
|
135
127
|
return;
|
|
136
128
|
}
|
|
137
129
|
if (abortSignal.aborted) {
|
|
138
|
-
console.log('Promise 생성자 패치: setTimeout 콜백이 중단된 경우');
|
|
139
130
|
throw new Error(`REQUEST_ABORTED: setTimeout 콜백이 중단되었습니다 (${contextId})`);
|
|
140
131
|
}
|
|
141
132
|
// eslint-disable-next-line prefer-spread
|
|
@@ -58,6 +58,10 @@ let RPCInterceptor = RPCInterceptor_1 = class RPCInterceptor {
|
|
|
58
58
|
this.gracefulShutdownService = gracefulShutdownService;
|
|
59
59
|
this.DEFAULT_TIMEOUT = 1000 * 60 * 29; // 29분 타임아웃
|
|
60
60
|
this.DEFAULT_TIMEOUT_MESSAGE = '요청이 타임아웃되었습니다.';
|
|
61
|
+
if (!RPCInterceptor_1.isPatched) {
|
|
62
|
+
context_promise_patch_1.ContextPromisePatch.patch();
|
|
63
|
+
RPCInterceptor_1.isPatched = true;
|
|
64
|
+
}
|
|
61
65
|
}
|
|
62
66
|
maxLengthOverShorten(data) {
|
|
63
67
|
if (typeof data !== 'string') {
|
|
@@ -323,10 +327,6 @@ let RPCInterceptor = RPCInterceptor_1 = class RPCInterceptor {
|
|
|
323
327
|
return new rxjs_1.Observable();
|
|
324
328
|
}
|
|
325
329
|
}
|
|
326
|
-
if (!RPCInterceptor_1.isPatched) {
|
|
327
|
-
context_promise_patch_1.ContextPromisePatch.patch();
|
|
328
|
-
RPCInterceptor_1.isPatched = true;
|
|
329
|
-
}
|
|
330
330
|
this.gracefulShutdownService.pushActiveInterceptors(execInterceptor);
|
|
331
331
|
// eslint-disable-next-line consistent-return
|
|
332
332
|
return functions_1.AbortContext.run(abortController.signal, execInterceptor.traceId, () => next
|
|
@@ -361,9 +361,7 @@ let RPCInterceptor = RPCInterceptor_1 = class RPCInterceptor {
|
|
|
361
361
|
error: localErrorProcessor,
|
|
362
362
|
}), (0, operators_1.finalize)(() => {
|
|
363
363
|
this.gracefulShutdownService.popActiveInterceptors(execInterceptor);
|
|
364
|
-
|
|
365
|
-
abortController.signal.removeEventListener('abort', () => { });
|
|
366
|
-
}
|
|
364
|
+
console.log('finalize called', execInterceptor.traceId);
|
|
367
365
|
functions_1.AbortContext.endContext();
|
|
368
366
|
abortController = null;
|
|
369
367
|
return new rxjs_1.Observable();
|