MCPcopy
hub / github.com/FlowiseAI/Flowise / getEmbeddingCache

Method getEmbeddingCache

packages/server/src/CachePool.ts:163–175  ·  view source on GitHub ↗

* Get item from embedding cache pool * @param {string} chatflowid

(chatflowid: string)

Source from the content-addressed store, hash-verified

161 * @param {string} chatflowid
162 */
163 async getEmbeddingCache(chatflowid: string): Promise<Map<any, any> | undefined> {
164 if (process.env.MODE === MODE.QUEUE) {
165 if (this.redisClient) {
166 const serializedValue = await this.redisClient.get(`embeddingCache:${chatflowid}`)
167 if (serializedValue) {
168 return new Map(JSON.parse(serializedValue))
169 }
170 }
171 } else {
172 return this.activeEmbeddingCache[chatflowid]
173 }
174 return undefined
175 }
176
177 /**
178 * Close Redis connection if applicable

Callers 1

initMethod · 0.80

Calls 2

parseMethod · 0.65
getMethod · 0.45

Tested by

no test coverage detected