Merge pull request #1633 from fletch-ai/bugfix/RedisCache-TTL

Bugfix/Switching Redis TTL from EX to PX to match TTL in milliseconds
This commit is contained in:
Henry Heng
2024-01-29 10:04:50 +00:00
committed by GitHub
+1 -1
View File
@@ -131,7 +131,7 @@ class RedisCache implements INode {
for (let i = 0; i < value.length; i += 1) { for (let i = 0; i < value.length; i += 1) {
const key = getCacheKey(prompt, llmKey, String(i)) const key = getCacheKey(prompt, llmKey, String(i))
if (ttl) { if (ttl) {
await client.set(key, JSON.stringify(serializeGeneration(value[i])), 'EX', parseInt(ttl, 10)) await client.set(key, JSON.stringify(serializeGeneration(value[i])), 'PX', parseInt(ttl, 10))
} else { } else {
await client.set(key, JSON.stringify(serializeGeneration(value[i]))) await client.set(key, JSON.stringify(serializeGeneration(value[i])))
} }