mirror of
https://github.com/redis/redis.git
synced 2026-05-28 04:02:46 -04:00
KSN: HEXPIRE-like commands should emit hdel if expire-time is in the past (#13408)
To be more similar to EXPIRE-like commands, which emit a "del" notification if the expire-time is in the past
This commit is contained in:
parent
81440a333d
commit
915a9e4b93
2 changed files with 3 additions and 3 deletions
|
|
@ -1171,11 +1171,11 @@ void hashTypeSetExDone(HashTypeSetEx *ex) {
|
|||
if (ex->fieldDeleted && hashTypeLength(ex->hashObj, 0) == 0) {
|
||||
dbDelete(ex->db,ex->key);
|
||||
signalModifiedKey(ex->c, ex->db, ex->key);
|
||||
notifyKeyspaceEvent(NOTIFY_HASH, "hexpired", ex->key, ex->db->id);
|
||||
notifyKeyspaceEvent(NOTIFY_HASH, "hdel", ex->key, ex->db->id);
|
||||
notifyKeyspaceEvent(NOTIFY_GENERIC,"del",ex->key, ex->db->id);
|
||||
} else {
|
||||
signalModifiedKey(ex->c, ex->db, ex->key);
|
||||
notifyKeyspaceEvent(NOTIFY_HASH, ex->fieldDeleted ? "hexpired" : "hexpire",
|
||||
notifyKeyspaceEvent(NOTIFY_HASH, ex->fieldDeleted ? "hdel" : "hexpire",
|
||||
ex->key, ex->db->id);
|
||||
|
||||
/* If minimum HFE of the hash is smaller than expiration time of the
|
||||
|
|
|
|||
|
|
@ -374,7 +374,7 @@ start_server {tags {"pubsub network"}} {
|
|||
assert_equal "pmessage * __keyspace@${db}__:myhash hexpire" [$rd1 read]
|
||||
assert_equal "pmessage * __keyspace@${db}__:myhash hexpire" [$rd1 read]
|
||||
assert_equal "pmessage * __keyspace@${db}__:myhash hpersist" [$rd1 read]
|
||||
assert_equal "pmessage * __keyspace@${db}__:myhash hexpired" [$rd1 read]
|
||||
assert_equal "pmessage * __keyspace@${db}__:myhash hdel" [$rd1 read]
|
||||
|
||||
# Test that we will get `hexpired` notification when
|
||||
# a hash field is removed by active expire.
|
||||
|
|
|
|||
Loading…
Reference in a new issue