Use lookupKeyWrite() for hpersist command (#13321)

As hpersist is a write command, we should use lookupKeyWrite() instead
of lookupKeyRead() to fetch the key.
This commit is contained in:
Ozan Tezcan 2024-06-04 12:04:37 +03:00 committed by GitHub
parent 44352beefa
commit 293a68afdf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -3115,7 +3115,7 @@ void hpersistCommand(client *c) {
int changed = 0; /* Used to determine whether to send a notification. */
/* Read the hash object */
if ((hashObj = lookupKeyReadOrReply(c, c->argv[1], shared.emptyarray)) == NULL ||
if ((hashObj = lookupKeyWriteOrReply(c, c->argv[1], shared.emptyarray)) == NULL ||
checkType(c, hashObj, OBJ_HASH)) return;
if (strcasecmp(c->argv[numFieldsAt-1]->ptr, "FIELDS")) {