From 0a4d223b3bed19e084ea3baa094fa87a081dc6c2 Mon Sep 17 00:00:00 2001 From: Sameer Dev Date: Mon, 13 Jan 2025 08:19:19 +0000 Subject: [PATCH] code update recorded at: 13/01/25 08:19:19 --- handler.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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));