As far as Redis do not allow to reSet expire date to key (because of nans with replication) I'd like to know is there any method to check if key set to be expired or not?
Thank you
Normally Redis keys are created without an associated time to live. The key will simply live forever, unless it is removed by the user in an explicit way, for instance using the DEL command.
To create a Redis with an expiration time, use the SET command and the EX option to set the expiration time. The EX option takes a number in seconds and sets the number of seconds the key is valid until expiration. You can also use PX to specify the expiration time in Milliseconds.
Use the TTL
command. If an expiration is set, it returns the number of seconds until the key expires; otherwise it returns -1.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With