This commit is contained in:
Bastian Wagner
2026-07-16 09:49:22 +02:00
commit 543e8273a7
157 changed files with 22761 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
import { AsyncLocalStorage } from 'node:async_hooks';
export interface RequestContext {
requestId: string;
userId?: string;
}
export const requestContextStorage = new AsyncLocalStorage<RequestContext>();
export function getRequestId(): string {
return requestContextStorage.getStore()?.requestId ?? 'unknown';
}