Skip to content

Commit

Permalink
Switching Redis TTL from EX to PX to match TTL in milliseconds (as sp…
Browse files Browse the repository at this point in the history
…ecified in the input param).
  • Loading branch information
Darien Kindlund committed Jan 29, 2024
1 parent e72d9e4 commit 63665b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/components/nodes/cache/RedisCache/RedisCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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])))
}
Expand Down

0 comments on commit 63665b3

Please sign in to comment.