(fn: () => Promise<T>)
| 82 | |
| 83 | /** Wrap a request so getSession()/flushDirtySessions() use a per-request cache. */ |
| 84 | export function runWithSessionContext<T>(fn: () => Promise<T>): Promise<T> { |
| 85 | const ctx: RequestSessionCtx = { sessions: new Map(), snapshots: new Map() }; |
| 86 | return requestCtx.run(ctx, fn); |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * Persist sessions that were actually mutated during the current request. |
no outgoing calls
no test coverage detected