fix ttl parseInt error

This commit is contained in:
Henry 2023-12-06 01:51:14 +00:00
parent 1867f9be02
commit 2da6f59834
1 changed files with 1 additions and 1 deletions

View File

@ -89,7 +89,7 @@ class RedisCache implements INode {
redisClient.update = async (prompt: string, llmKey: string, value: Generation[]) => {
for (let i = 0; i < value.length; i += 1) {
const key = getCacheKey(prompt, llmKey, String(i))
if (ttl !== undefined) {
if (ttl) {
await client.set(key, JSON.stringify(serializeGeneration(value[i])), 'EX', parseInt(ttl, 10))
} else {
await client.set(key, JSON.stringify(serializeGeneration(value[i])))