[Cache] Dont use pipelining with RedisCluster

This commit is contained in:
Nicolas Grekas 2017-05-27 11:47:24 +02:00
parent ec4689122c
commit eb93ac904c

View File

@ -303,6 +303,14 @@ class RedisAdapter extends AbstractAdapter
foreach ($results as $k => list($h, $c)) {
$results[$k] = $connections[$h][$c];
}
} elseif ($this->redis instanceof \RedisCluster) {
// phpredis doesn't support pipelining with RedisCluster
// see https://github.com/phpredis/phpredis/blob/develop/cluster.markdown#pipelining
$result = array();
foreach ($generator() as $command => $args) {
$ids[] = $args[0];
$result[] = call_user_func_array(array($this->redis, $command), $args);
}
} else {
$this->redis->multi(\Redis::PIPELINE);
foreach ($generator() as $command => $args) {