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

Function getStore

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

Source from the content-addressed store, hash-verified

55let storeInstance: AdcpStateStore | null = null;
56
57function getStore(): AdcpStateStore {
58 if (storeInstance) return storeInstance;
59 storeInstance = isDatabaseInitialized()
60 ? new PostgresStateStore(getPool())
61 : new InMemoryStateStore();
62 return storeInstance;
63}
64
65/** Override the store (tests only — refuses to run in production). */
66export function setStateStore(store: AdcpStateStore | null): void {

Callers 2

flushDirtySessionsFunction · 0.85
getSessionFunction · 0.85

Calls 2

isDatabaseInitializedFunction · 0.85
getPoolFunction · 0.85

Tested by

no test coverage detected