@yolo-croket-dev/core 1.7.44-slowquery.4 → 1.7.44-slowquery.5
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.
|
@@ -172,11 +172,14 @@ class ContextPromisePatch {
|
|
|
172
172
|
}
|
|
173
173
|
this.contextTimers.get(contextId).add(timeoutId);
|
|
174
174
|
this.timerContextMap.set(timeoutId, contextId);
|
|
175
|
+
// 클로저로 필요한 정보를 캡처 (컨텍스트가 disable되어도 동작)
|
|
176
|
+
const capturedContextId = contextId;
|
|
177
|
+
const capturedActiveTimers = activeTimers;
|
|
175
178
|
const onAbort = () => {
|
|
176
179
|
var _a;
|
|
177
180
|
this.originalClearTimeout(timeoutId);
|
|
178
|
-
|
|
179
|
-
(_a = this.contextTimers.get(
|
|
181
|
+
capturedActiveTimers.delete(timeoutId);
|
|
182
|
+
(_a = this.contextTimers.get(capturedContextId)) === null || _a === void 0 ? void 0 : _a.delete(timeoutId);
|
|
180
183
|
this.timerContextMap.delete(timeoutId);
|
|
181
184
|
};
|
|
182
185
|
abortSignal.addEventListener('abort', onAbort, { once: true });
|
|
@@ -228,11 +231,14 @@ class ContextPromisePatch {
|
|
|
228
231
|
}
|
|
229
232
|
this.contextTimers.get(contextId).add(intervalId);
|
|
230
233
|
this.timerContextMap.set(intervalId, contextId);
|
|
234
|
+
// 클로저로 필요한 정보를 캡처 (컨텍스트가 disable되어도 동작)
|
|
235
|
+
const capturedContextId = contextId;
|
|
236
|
+
const capturedActiveTimers = activeTimers;
|
|
231
237
|
const onAbort = () => {
|
|
232
238
|
var _a;
|
|
233
239
|
this.originalClearInterval(intervalId);
|
|
234
|
-
|
|
235
|
-
(_a = this.contextTimers.get(
|
|
240
|
+
capturedActiveTimers.delete(intervalId);
|
|
241
|
+
(_a = this.contextTimers.get(capturedContextId)) === null || _a === void 0 ? void 0 : _a.delete(intervalId);
|
|
236
242
|
this.timerContextMap.delete(intervalId);
|
|
237
243
|
};
|
|
238
244
|
abortSignal.addEventListener('abort', onAbort, { once: true });
|
|
@@ -359,8 +359,11 @@ let RPCInterceptor = class RPCInterceptor {
|
|
|
359
359
|
this.gracefulShutdownService.popActiveInterceptors(execInterceptor);
|
|
360
360
|
// 활성 타이머를 모두 정리
|
|
361
361
|
context_promise_patch_1.ContextPromisePatch.clearContextTimers(execInterceptor.traceId);
|
|
362
|
-
functions_1.AbortContext.disable();
|
|
363
362
|
abortController = null;
|
|
363
|
+
// disable을 충분히 지연시켜서 모든 이벤트 리스너가 완료될 때까지 기다림
|
|
364
|
+
setTimeout(() => {
|
|
365
|
+
functions_1.AbortContext.disable();
|
|
366
|
+
}, 100);
|
|
364
367
|
return rxjs_1.EMPTY;
|
|
365
368
|
})));
|
|
366
369
|
}
|