H
H
Hanry6542020-01-02 22:27:04
Redis
Hanry654, 2020-01-02 22:27:04

Is it possible to get a callback when a key expires in redis?

I use the redis
library What I wanted to do is write the key data to the database at the expiration of the lifetime.
Tyk as I have a bot and every time after the user's command to change the values ​​​​in the database is like this.

Right off the bat, 2 questions:
1) What will happen if the same key is given new data and set a new lifetime?
Does Redis treat this as an expiration and notify me?
2) Maybe there are some pitfalls that I don't know about?
If yes, can you suggest other options?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Kitaev, 2020-01-02
@Hanry654

You can
https://redis.io/topics/notifications

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question