Compare commits

..

4 Commits

Author SHA1 Message Date
Sameer Dev 76dd3d8552 code update recorded at: 13/01/25 08:23:01 2025-01-13 08:23:01 +00:00
Sameer Dev 8830411787 code update recorded at: 13/01/25 08:21:29 2025-01-13 08:21:29 +00:00
Sameer Dev 0a4d223b3b code update recorded at: 13/01/25 08:19:19 2025-01-13 08:19:19 +00:00
Sameer Dev fa1780a61f code update recorded at: 13/01/25 08:15:31 2025-01-13 08:15:31 +00:00

View File

@ -162,12 +162,12 @@ export const handler = async (req, res) => {
const { command, key, value, ttl, secretData } = body; const { command, key, value, ttl, secretData } = body;
const client = await getOrCreateConnection({ secretData }); const client = await getOrCreateConnection({ secretData });
console.log("ttl",ttl)
var result var result
if (command === "GET") { if (command === "GET") {
result = await client.get(key); result = await client.get(key);
} else if (command === "SET") { } 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)); console.log('Command executed successfully:', JSON.stringify(result));