@yolo-croket-dev/core 1.7.38-slowquery.3 → 1.7.38-slowquery.4
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.
|
@@ -11,7 +11,7 @@ interface RequestContext {
|
|
|
11
11
|
export declare class AbortContext {
|
|
12
12
|
private static asyncLocalStorage;
|
|
13
13
|
private static contextCounter;
|
|
14
|
-
static run<T>(abortSignal: AbortSignal, requestId: string, callback: () => T): T;
|
|
14
|
+
static run<T>(abortSignal: AbortSignal, requestId: string, callback: (context: RequestContext) => T): T;
|
|
15
15
|
static getCurrentAbortSignal(): AbortSignal | null;
|
|
16
16
|
static getCurrentRequestId(): string | null;
|
|
17
17
|
static getCurrentContext(): {
|
|
@@ -12,7 +12,7 @@ class AbortContext {
|
|
|
12
12
|
createdAt: Date.now(),
|
|
13
13
|
parentContext: currentContext || undefined,
|
|
14
14
|
};
|
|
15
|
-
return this.asyncLocalStorage.run(newContext, callback);
|
|
15
|
+
return this.asyncLocalStorage.run(newContext, callback.bind(this, newContext));
|
|
16
16
|
}
|
|
17
17
|
static getCurrentAbortSignal() {
|
|
18
18
|
const context = this.asyncLocalStorage.getStore();
|
|
@@ -329,7 +329,7 @@ let RPCInterceptor = RPCInterceptor_1 = class RPCInterceptor {
|
|
|
329
329
|
}
|
|
330
330
|
this.gracefulShutdownService.pushActiveInterceptors(execInterceptor);
|
|
331
331
|
// eslint-disable-next-line consistent-return
|
|
332
|
-
return functions_1.AbortContext.run(abortController.signal, execInterceptor.traceId, () => next
|
|
332
|
+
return functions_1.AbortContext.run(abortController.signal, execInterceptor.traceId, (context) => next
|
|
333
333
|
.handle()
|
|
334
334
|
.pipe((0, operators_1.timeout)({
|
|
335
335
|
each: this.DEFAULT_TIMEOUT,
|
|
@@ -362,7 +362,7 @@ let RPCInterceptor = RPCInterceptor_1 = class RPCInterceptor {
|
|
|
362
362
|
}), (0, operators_1.finalize)(() => {
|
|
363
363
|
this.gracefulShutdownService.popActiveInterceptors(execInterceptor);
|
|
364
364
|
console.log('finalize called', execInterceptor.traceId);
|
|
365
|
-
functions_1.AbortContext.endContext();
|
|
365
|
+
functions_1.AbortContext.endContext(context);
|
|
366
366
|
abortController = null;
|
|
367
367
|
return new rxjs_1.Observable();
|
|
368
368
|
})));
|