how expire key with callback
See original GitHub issuevar Redis = require('ioredis');
redis = new Redis();
var key = 'expire_test';
var content ='content'
var timeout = 10;
redis.multi()
.set(key, content)
.expire(key, timeout, function(){
console.log('out');
})
.exec(function(err) {
if(err) {
console.error("Failed to publish EXPIRE EVENT for " + content);
console.error(err);
return;
}
});
like this?
.expire(key, timeout, function(){
console.log('out');
})
Issue Analytics
- State:
- Created 8 years ago
- Comments:16 (12 by maintainers)
Top Results From Across the Web
How to get callback when key expires in REDIS
I'm storing this key in REDIS with expiry of 4 days. If user does not confirm email within 4 days, key gets expired....
Read more >Redis — Getting Notified When a Key is Expired or Changed
Key expiration IS NOT REAL TIME, while it seems like a real time if you try on local (small key), it's already stated...
Read more >Callback when a key expires · Issue #529 · dgraph-io/badger
There's no exact moment in time when a key is deleted. If a key is expired, Badger would just not return it anymore,...
Read more >How to write your own Redis key expire listener in Python
How to write your own Redis key expire listener in Python · Run below command redis-cli config set notify-keyspace-events Ex · Update Redis...
Read more >EXPIRE
It is possible to call EXPIRE using as argument a key that already has an existing expire set. In this case the time...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
这个没法实现到期提醒,只能实现删除提醒。比如 expire 一个键 100 秒过期,Redis 不会恰好在第一百秒删除这个键,而是在下一次访问这个键或者后台垃圾回收时才会真正删除它
Hey guys, can you explain what’s the final behaviour?