diff --git a/handler.js b/handler.js index 29f31a6..8bc7f6d 100644 --- a/handler.js +++ b/handler.js @@ -162,12 +162,12 @@ export const handler = async (req, res) => { const { command, key, value, ttl, secretData } = body; const client = await getOrCreateConnection({ secretData }); - console.log("ttl", ttl, ttl || 0) + var result if (command === "GET") { result = await client.get(key); } else if (command === "SET") { - result = await client.set(key, value, "EX", ttl || 0); + result = ttl ? await client.set(key, value, "EX", ttl) : await client.set(key, value); } console.log('Command executed successfully:', JSON.stringify(result));