MCPcopy Create free account
hub / github.com/cameri/nostream / getCacheClient

Function getCacheClient

src/cache/client.ts:54–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52let instance: CacheClient | undefined = undefined
53
54export const getCacheClient = (): CacheClient => {
55 if (!instance) {
56 const config = getCacheConfig()
57 // eslint-disable-next-line @typescript-eslint/no-unused-vars
58 const { password: _, ...loggableConfig } = config
59 logger('config: %o', {
60 ...loggableConfig,
61 ...(loggableConfig.url ? { url: redactRedisUrlCredentials(loggableConfig.url) } : {}),
62 })
63 instance = createClient(config)
64 }
65
66 return instance
67}
68
69export const closeCacheClient = async (): Promise<void> => {
70 if (instance?.isOpen) {

Callers 2

getCacheFunction · 0.90
rateLimiterFactoryFunction · 0.90

Calls 2

getCacheConfigFunction · 0.85

Tested by

no test coverage detected