Skip to content

Commit 0a8c736

Browse files
committed
[12.x] flushValues for PredisCluster in RedisTaggedCache
1 parent 2a67dc1 commit 0a8c736

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Illuminate/Cache/RedisTaggedCache.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,17 @@ protected function flushValues()
193193
->map(fn (string $key) => $this->store->getPrefix().$key)
194194
->chunk(1000);
195195

196+
$connection = $this->store->connection();
196197
foreach ($entries as $cacheKeys) {
197-
$this->store->connection()->del(...$cacheKeys);
198+
if ($connection instanceof PredisClusterConnection) {
199+
$connection->pipeline(function ($connection) use ($cacheKeys) {
200+
foreach ($cacheKeys as $cacheKey) {
201+
$connection->del($cacheKey);
202+
}
203+
});
204+
} else {
205+
$connection->del(...$cacheKeys);
206+
}
198207
}
199208
}
200209

0 commit comments

Comments
 (0)