Switching Redis TTL from EX to PX to match TTL in milliseconds (as specified in the input param).

This commit is contained in:
Darien Kindlund 2024-01-28 21:58:04 -08:00
parent e72d9e4094
commit 63665b37ce
1 changed files with 1 additions and 1 deletions

View File

@ -131,7 +131,7 @@ class RedisCache implements INode {
for (let i = 0; i < value.length; i += 1) {
const key = getCacheKey(prompt, llmKey, String(i))
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 {
await client.set(key, JSON.stringify(serializeGeneration(value[i])))
}