[Cache] Fix clear() when using Predis

This commit is contained in:
Nicolas Grekas
2024-11-04 12:43:46 +01:00
parent 12b03e3cc5
commit 0fe08ee32c

View File

@@ -492,7 +492,7 @@ trait RedisTrait
$cursor = null;
do {
$keys = $host instanceof \Predis\ClientInterface ? $host->scan($cursor, 'MATCH', $pattern, 'COUNT', 1000) : $host->scan($cursor, $pattern, 1000);
$keys = $host instanceof \Predis\ClientInterface ? $host->scan($cursor ?? 0, 'MATCH', $pattern, 'COUNT', 1000) : $host->scan($cursor, $pattern, 1000);
if (isset($keys[1]) && \is_array($keys[1])) {
$cursor = $keys[0];
$keys = $keys[1];