Commit 20eeddfb authored by antirez's avatar antirez
Browse files

Signal key as modified when expired on-access.

This fixes WATCH and client side caching with keys expiring because of
a synchronous access and not because of background expiring.
parent 090bc0c1
...@@ -1296,8 +1296,10 @@ int expireIfNeeded(redisDb *db, robj *key) { ...@@ -1296,8 +1296,10 @@ int expireIfNeeded(redisDb *db, robj *key) {
propagateExpire(db,key,server.lazyfree_lazy_expire); propagateExpire(db,key,server.lazyfree_lazy_expire);
notifyKeyspaceEvent(NOTIFY_EXPIRED, notifyKeyspaceEvent(NOTIFY_EXPIRED,
"expired",key,db->id); "expired",key,db->id);
return server.lazyfree_lazy_expire ? dbAsyncDelete(db,key) : int retval = server.lazyfree_lazy_expire ? dbAsyncDelete(db,key) :
dbSyncDelete(db,key); dbSyncDelete(db,key);
if (retval) signalModifiedKey(db,key);
return retval;
} }
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment