Skip to content

Commit

Permalink
fix: return false on empty scan
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 5c09a9d commit 2db7387
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/private/Memcache/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ public function clear($prefix = '') {
// Use SCAN to iterate over keys
$cursor = 0;
do {
[$cursor, $keys] = $cache->scan($cursor, $prefix);
$arr_keys = $cache->scan($cursor, $prefix);
if ($arr_keys === false) {
return false;
}

[$cursor, $keys] = $arr_keys;
if (!empty($keys)) {
$deletedCount += $cache->unlink($keys);
}
Expand Down

0 comments on commit 2db7387

Please sign in to comment.