diff --git a/src/sort.c b/src/sort.c index a44a6d63ba891ca21ea32c2fe881c58b62750dd1..cf188c699b52006f1450f6f53822a81fcd29593a 100644 --- a/src/sort.c +++ b/src/sort.c @@ -363,6 +363,7 @@ void sortCommand(redisClient *c) { } } } + lookupKeyWrite(c->db,storekey); /* Force expire of old key if needed. */ dbReplace(c->db,storekey,sobj); /* Note: we add 1 because the DB is dirty anyway since even if the * SORT result is empty a new key is set and maybe the old content diff --git a/src/t_string.c b/src/t_string.c index b96198c8d16026b4fc84220278e09a786266f41c..5539195a9c5b77a9bd93198063bb5099e7d843bb 100644 --- a/src/t_string.c +++ b/src/t_string.c @@ -25,6 +25,7 @@ void setGenericCommand(redisClient *c, int nx, robj *key, robj *val, robj *expir } } + lookupKeyWrite(c->db,key); /* Force expire of old key if needed */ retval = dbAdd(c->db,key,val); if (retval == REDIS_ERR) { if (!nx) {