Commit 6f864e62 authored by antirez's avatar antirez
Browse files

dictGetRandomKey bug fixed, RANDOMKEY will not block the server anymore

parent ca37e9cd
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 Redis 0.091 released
2009-04-10 SINTER/SINTERSTORE/SLEMENTS fix: misisng keys are now not errors, but just like empty sets 2009-04-10 SINTER/SINTERSTORE/SLEMENTS fix: misisng keys are now not errors, but just like empty sets
2009-04-09 doc changes 2009-04-09 doc changes
......
...@@ -68,6 +68,12 @@ class Redis { ...@@ -68,6 +68,12 @@ class Redis {
$this->write("GET $name\r\n"); $this->write("GET $name\r\n");
return $this->get_response(); 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) { public function incr($name, $amount=1) {
$this->connect(); $this->connect();
......
...@@ -377,7 +377,7 @@ dictEntry *dictGetRandomKey(dict *ht) ...@@ -377,7 +377,7 @@ dictEntry *dictGetRandomKey(dict *ht)
unsigned int h; unsigned int h;
int listlen, listele; int listlen, listele;
if (ht->size == 0) return NULL; if (ht->used == 0) return NULL;
do { do {
h = random() & ht->sizemask; h = random() & ht->sizemask;
he = ht->table[h]; he = ht->table[h];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment