MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / runWithAlsSession

Function runWithAlsSession

packages/db/src/session-context.ts:7–10  ·  view source on GitHub ↗
(
  sid: string | null | undefined,
  fn: () => Promise<T>,
)

Source from the content-addressed store, hash-verified

5export const als = new AsyncLocalStorage<Ctx>();
6
7export const runWithAlsSession = <T>(
8 sid: string | null | undefined,
9 fn: () => Promise<T>,
10) => als.run({ sessionId: sid || null }, fn);
11
12export const getAlsSessionId = () => als.getStore()?.sessionId ?? null;

Callers 2

trpc.tsFile · 0.90
buildAppFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected