[Cache] Only delete one key at a time when on Predis + Cluster
This commit is contained in:
parent
0127b26a88
commit
f5ece20a83
@ -272,7 +272,17 @@ trait RedisTrait
|
|||||||
*/
|
*/
|
||||||
protected function doDelete(array $ids)
|
protected function doDelete(array $ids)
|
||||||
{
|
{
|
||||||
if ($ids) {
|
if (!$ids) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->redis instanceof \Predis\Client && $this->redis->getConnection() instanceof ClusterInterface) {
|
||||||
|
$this->pipeline(function () use ($ids) {
|
||||||
|
foreach ($ids as $id) {
|
||||||
|
yield 'del' => [$id];
|
||||||
|
}
|
||||||
|
})->rewind();
|
||||||
|
} else {
|
||||||
$this->redis->del($ids);
|
$this->redis->del($ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user