https://redis.io/docs/manual/keyspace-notifications/#timing-of-expired-eventsThe expired events are generated when a key is accessed and is found to be expired by one of the above systems, as a result there are no guarantees that the Redis server will be able to generate the expired event at the time the key time to live reaches the value of zero.
If no command targets the key constantly, and there are many keys with a TTL associated, there can be a significant delay between the time the key time to live drops to zero, and the time the expired event is generated.
Basically expired events are generated when the Redis server deletes the key and not when the time to live theoretically reaches the value of zero.
【 在 zhangkung 的大作中提到: 】
: 监听expire事件的思路可行。
: 假设调用的是abcde任务。
: 发出调用时,设置key。
: ...................
--
FROM 222.70.22.*