MCPcopy
hub / github.com/learnhouse/learnhouse / getRedis

Function getRedis

apps/collab/src/index.ts:87–101  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

85let redis: Redis | null = null
86
87function getRedis(): Redis {
88 if (!redis) {
89 redis = new Redis(REDIS_URL, {
90 maxRetriesPerRequest: 3,
91 lazyConnect: true,
92 })
93 redis.on('error', (err) => {
94 console.error('[collab] Redis error:', err.message)
95 })
96 redis.connect().catch((err) => {
97 console.error('[collab] Redis connection failed:', err)
98 })
99 }
100 return redis
101}
102
103function redisYdocKey(boardUuid: string): string {
104 return `collab:ydoc:${boardUuid}`

Callers 2

fetchFunction · 0.85
storeFunction · 0.85

Calls 2

onMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected