Compare commits

...

4 Commits

View File

@ -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)
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));