Skip to content

Commit

Permalink
fix: psalm
Browse files Browse the repository at this point in the history
Signed-off-by: Git'Fellow <[email protected]>
  • Loading branch information
solracsf authored Nov 17, 2024
1 parent b391bb6 commit d604bb1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/private/Memcache/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,13 @@ public function clear($prefix = '') {
$deletedCount = 0;

// Use SCAN to iterate over keys
$cursor = null;
$cursor = 0;
do {
$keys = $cache->scan($cursor, $prefix);
if ($keys !== false) {
$deletedCount += $cache->unlink($keys);
if ($keys !== false && !empty($keys)) {
foreach ($keys as $key) {
$deletedCount += $cache->unlink($key);
}
}
} while ($cursor > 0);

Expand Down

0 comments on commit d604bb1

Please sign in to comment.