MCPcopy Index your code
hub / github.com/coder/mux / withApiSession

Method withApiSession

src/node/services/coderService.ts:524–534  ·  view source on GitHub ↗
(
    tokenName: string,
    fn: (session: CoderApiSession) => Promise<T>
  )

Source from the content-addressed store, hash-verified

522 }
523
524 private async withApiSession<T>(
525 tokenName: string,
526 fn: (session: CoderApiSession) => Promise<T>
527 ): Promise<T> {
528 const session = await this.createApiSession(tokenName);
529 try {
530 return await fn(session);
531 } finally {
532 await session.dispose();
533 }
534 }
535
536 async ensureProvisioningSession(workspaceName: string): Promise<CoderApiSession> {
537 const existing = this.provisioningSessions.get(workspaceName);

Callers 1

Calls 2

createApiSessionMethod · 0.95
disposeMethod · 0.65

Tested by

no test coverage detected