@yolo-croket-dev/core 1.7.32-slowquery.0 → 1.7.32-slowquery.1
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
export declare class AbortContext {
|
|
3
3
|
private static asyncLocalStorage;
|
|
4
|
+
private static contextCounter;
|
|
4
5
|
static run<T>(abortSignal: AbortSignal, requestId: string, callback: () => T): T;
|
|
5
6
|
static getCurrentAbortSignal(): AbortSignal | null;
|
|
6
7
|
static getCurrentRequestId(): string | null;
|
|
@@ -7,7 +7,8 @@ class AbortContext {
|
|
|
7
7
|
const currentContext = this.asyncLocalStorage.getStore();
|
|
8
8
|
const newContext = {
|
|
9
9
|
abortSignal,
|
|
10
|
-
|
|
10
|
+
// eslint-disable-next-line no-plusplus
|
|
11
|
+
requestId: `ctx_${++this.contextCounter}_${Date.now()}`,
|
|
11
12
|
createdAt: Date.now(),
|
|
12
13
|
parentContext: currentContext || undefined,
|
|
13
14
|
};
|
|
@@ -57,3 +58,4 @@ class AbortContext {
|
|
|
57
58
|
}
|
|
58
59
|
exports.AbortContext = AbortContext;
|
|
59
60
|
AbortContext.asyncLocalStorage = new async_hooks_1.AsyncLocalStorage();
|
|
61
|
+
AbortContext.contextCounter = 0;
|