Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f5ece20

Browse filesBrowse files
committed
[Cache] Only delete one key at a time when on Predis + Cluster
1 parent 0127b26 commit f5ece20
Copy full SHA for f5ece20

File tree

1 file changed

+11
-1
lines changed
Filter options

1 file changed

+11
-1
lines changed

‎src/Symfony/Component/Cache/Traits/RedisTrait.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Traits/RedisTrait.php
+11-1Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,17 @@ protected function doClear($namespace)
272272
*/
273273
protected function doDelete(array $ids)
274274
{
275-
if ($ids) {
275+
if (!$ids) {
276+
return true;
277+
}
278+
279+
if ($this->redis instanceof \Predis\Client && $this->redis->getConnection() instanceof ClusterInterface) {
280+
$this->pipeline(function () use ($ids) {
281+
foreach ($ids as $id) {
282+
yield 'del' => [$id];
283+
}
284+
})->rewind();
285+
} else {
276286
$this->redis->del($ids);
277287
}
278288

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.