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.
This commit is contained in:
antirez 2020-02-14 18:22:25 +01:00
parent 090bc0c1a3
commit 20eeddfb8a

View File

@ -1296,8 +1296,10 @@ int expireIfNeeded(redisDb *db, robj *key) {
propagateExpire(db,key,server.lazyfree_lazy_expire);
notifyKeyspaceEvent(NOTIFY_EXPIRED,
"expired",key,db->id);
return server.lazyfree_lazy_expire ? dbAsyncDelete(db,key) :
dbSyncDelete(db,key);
int retval = server.lazyfree_lazy_expire ? dbAsyncDelete(db,key) :
dbSyncDelete(db,key);
if (retval) signalModifiedKey(db,key);
return retval;
}
/* -----------------------------------------------------------------------------