MCPcopy Index your code
hub / github.com/simstudioai/sim / getCachedProviderClient

Function getCachedProviderClient

apps/sim/providers/client-cache.ts:22–31  ·  view source on GitHub ↗
(key: string, factory: () => T)

Source from the content-addressed store, hash-verified

20 * making it the tenant boundary (clients are never shared across keys).
21 */
22export function getCachedProviderClient<T extends object>(key: string, factory: () => T): T {
23 const existing = clientCache.get(key)
24 if (existing) {
25 return existing as T
26 }
27
28 const client = factory()
29 clientCache.set(key, client)
30 return client
31}
32
33/** Clears the cache so tests asserting client construction start from a miss. */
34export function clearProviderClientCacheForTests(): void {

Callers 5

index.tsFile · 0.90
index.tsFile · 0.90
index.tsFile · 0.90
index.tsFile · 0.90

Calls 2

getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected