Compare commits
3 Commits
13-01-25-f
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76dd3d8552 | ||
|
|
8830411787 | ||
|
|
0a4d223b3b |
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user