question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

how to set expire time

See original GitHub issue
client.set(key, value)

how to set a expire time

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:24
  • Comments:50 (14 by maintainers)

github_iconTop GitHub Comments

233reactions
BridgeARcommented, Mar 30, 2016

Please check the commands dcoumentation. Every part has it’s own parameter so you would write something like:

client.set(key, value, 'EX', 60 * 60 * 24, callback);
171reactions
ryanvanderpolcommented, Nov 1, 2016

@BridgeAR: Understood, but you’re kind of missing the point. Perhaps this is just me being lazy, but I refuse to learn the entire native Redis API just so I can stick things in and pull things out. Maybe I shouldn’t be using the node_redis library then. Maybe I should be using something else that sits on top of it and abstracts this away from me. However, like I said before, I think most people use Redis as a cache and there is nothing in the node_redis documentation that even mentions the word “expire” or “expiration” (or even the “EX” command or TTLs) so without digging into the official Redis documentation it’s hard to understand how to actually set a TTL for a key, an action that I expect the majority of people will need to do.

Read more comments on GitHub >

github_iconTop Results From Across the Web

EXPIRE - Redis
Set a key's time to live in seconds.
Read more >
Set a message expiration date - Microsoft Support
Under Delivery Options, check the box for Expires after and select a date and time for your message to expire. Click Close, then...
Read more >
How to Set Expiry Time (TTL) for LocalStorage With Javascript
This post will explain how to implement expiry times for items stored in the browsers localStorage.
Read more >
Setting Expiry in Redis - Medium
This article features a video on Setting Expiry in Redis. So, we will learn how you can set an expiry time to your...
Read more >
How to set Expire time for an alarm in the Object server - IBM
ExpireTime should be set to the number of seconds you want the event to live. If you want it to expire after 24...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Hashnode Post

No results found