mirror of https://mirror.osredm.com/root/redis.git
Check key expiration before deleting
Deleting an expired key should return 0, not success. Fixes #1648
This commit is contained in:
parent
67bb2c46b2
commit
83d2830372
1
src/db.c
1
src/db.c
|
@ -280,6 +280,7 @@ void delCommand(redisClient *c) {
|
||||||
int deleted = 0, j;
|
int deleted = 0, j;
|
||||||
|
|
||||||
for (j = 1; j < c->argc; j++) {
|
for (j = 1; j < c->argc; j++) {
|
||||||
|
expireIfNeeded(c->db,c->argv[j]);
|
||||||
if (dbDelete(c->db,c->argv[j])) {
|
if (dbDelete(c->db,c->argv[j])) {
|
||||||
signalModifiedKey(c->db,c->argv[j]);
|
signalModifiedKey(c->db,c->argv[j]);
|
||||||
notifyKeyspaceEvent(REDIS_NOTIFY_GENERIC,
|
notifyKeyspaceEvent(REDIS_NOTIFY_GENERIC,
|
||||||
|
|
Loading…
Reference in New Issue