Compare commits

..

No commits in common. "main" and "13-01-25-fa1780" have entirely different histories.

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, ttl || 0)
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 = ttl ? await client.set(key, value, "EX", ttl) : await client.set(key, value); result = await client.set(key, value, "EX", ttl || 0);
} }
console.log('Command executed successfully:', JSON.stringify(result)); console.log('Command executed successfully:', JSON.stringify(result));