Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a75abfd

Browse files
[Cache] Dont use pipelining with RedisCluster
1 parent ec46891 commit a75abfd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Symfony/Component/Cache/Adapter/RedisAdapter.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,14 @@ private function pipeline(\Closure $generator)
303303
foreach ($results as $k => list($h, $c)) {
304304
$results[$k] = $connections[$h][$c];
305305
}
306+
} elseif ($this->redis instanceof \RedisCluster) {
307+
// phpredis doesn't support pipelining with RedisCluster
308+
// see https://github.com/phpredis/phpredis/blob/develop/cluster.markdown#pipelining
309+
$result = [];
310+
foreach ($generator() as $command => $args) {
311+
$ids[] = $args[0];
312+
$result[] = call_user_func_array(array($this->redis, $command), $args);
313+
}
306314
} else {
307315
$this->redis->multi(\Redis::PIPELINE);
308316
foreach ($generator() as $command => $args) {

0 commit comments

Comments
 (0)