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

Function getCacheConfig

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

Source from the content-addressed store, hash-verified

22}
23
24export const getCacheConfig = (): RedisClientOptions => {
25 const password = process.env.REDIS_PASSWORD
26
27 if (process.env.REDIS_URI) {
28 return {
29 url: process.env.REDIS_URI,
30 ...(password ? { password } : {}),
31 }
32 }
33
34 const host = process.env.REDIS_HOST
35 const port = process.env.REDIS_PORT
36
37 if (password) {
38 const username = process.env.REDIS_USER ?? 'default'
39
40 return {
41 url: `redis://${host}:${port}`,
42 username,
43 password,
44 }
45 }
46
47 return {
48 url: `redis://${host}:${port}`,
49 }
50}
51
52let instance: CacheClient | undefined = undefined
53

Callers 3

rate-limiter.tsFile · 0.90
client.spec.tsFile · 0.90
getCacheClientFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected