dictGetRandomKey bug fixed, RANDOMKEY will not block the server anymore

This commit is contained in:
antirez 2009-04-23 18:46:11 +02:00
parent ca37e9cde8
commit 6f864e6266
3 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2009-04-22 FLUSHALL/FLUSHDB no longer sync on disk. Just increment the dirty counter by the number of elements removed, that will probably trigger a background saving operation
2009-04-21 forgot to comment testing code in PHP lib. Now it is ok
2009-04-21 PHP client ported to PHP5 and fixed
2009-04-21 doc update
2009-04-20 Non blocking replication (finally!). C-side linked lists API improved.
2009-04-19 SUNION, SUNIONSTORE, Initial work on non blocking replication
2009-04-10 Redis 0.091 released
2009-04-10 SINTER/SINTERSTORE/SLEMENTS fix: misisng keys are now not errors, but just like empty sets
2009-04-09 doc changes

View File

@ -68,6 +68,12 @@ class Redis {
$this->write("GET $name\r\n");
return $this->get_response();
}
public function mget($keys) {
$this->connect();
$this->write("MGET ".implode(" ",$keys)."\r\n");
return $this->get_response();
}
public function incr($name, $amount=1) {
$this->connect();

2
dict.c
View File

@ -377,7 +377,7 @@ dictEntry *dictGetRandomKey(dict *ht)
unsigned int h;
int listlen, listele;
if (ht->size == 0) return NULL;
if (ht->used == 0) return NULL;
do {
h = random() & ht->sizemask;
he = ht->table[h];