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

Function getIdempotencyStore

server/src/training-agent/idempotency.ts:116–123  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

114let storeInstance: IdempotencyStore | null = null;
115
116export function getIdempotencyStore(): IdempotencyStore {
117 if (storeInstance) return storeInstance;
118 const backend = isDatabaseInitialized()
119 ? pgBackend(getPool())
120 : memoryBackend();
121 storeInstance = createIdempotencyStore({ backend, ttlSeconds: REPLAY_TTL_SECONDS });
122 return storeInstance;
123}
124
125/** Reset the store — tests only. Safe to call when no store has been created. */
126export async function clearIdempotencyCache(): Promise<void> {

Callers 4

startMethod · 0.85
dispatchCallToolFunction · 0.85

Calls 2

isDatabaseInitializedFunction · 0.85
getPoolFunction · 0.85

Tested by

no test coverage detected