mirror of
https://github.com/fluencelabs/redis
synced 2025-06-22 21:41:32 +00:00
RANDOMKEY issue 26 fixed, generic test + regression added
This commit is contained in:
3
redis.c
3
redis.c
@ -2237,9 +2237,10 @@ static void randomkeyCommand(redisClient *c) {
|
||||
|
||||
while(1) {
|
||||
de = dictGetRandomKey(c->db->dict);
|
||||
if (expireIfNeeded(c->db,dictGetEntryKey(de)) == 0) break;
|
||||
if (!de || expireIfNeeded(c->db,dictGetEntryKey(de)) == 0) break;
|
||||
}
|
||||
if (de == NULL) {
|
||||
addReply(c,shared.plus);
|
||||
addReply(c,shared.crlf);
|
||||
} else {
|
||||
addReply(c,shared.plus);
|
||||
|
Reference in New Issue
Block a user