MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / clearSessions

Function clearSessions

server/src/training-agent/state.ts:511–525  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

509
510/** Clear all sessions (tests only). */
511export async function clearSessions(): Promise<void> {
512 const ctx = requestCtx.getStore();
513 if (ctx) {
514 ctx.sessions.clear();
515 ctx.snapshots.clear();
516 }
517 const store = storeInstance;
518 if (!store) return;
519 if (store instanceof InMemoryStateStore) {
520 store.clear();
521 } else if (store instanceof PostgresStateStore) {
522 await store.clearCollection(SESSIONS_COLLECTION);
523 }
524 // Other AdcpStateStore implementations: no-op. Tests should inject a known store.
525}

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected