Skip to content

Commit

Permalink
do not store keys in arrays, delete immediatly (#4495)
Browse files Browse the repository at this point in the history
  • Loading branch information
aynsix authored Apr 29, 2024
1 parent fd4adfc commit f2744ce
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/Alchemy/Phrasea/Cache/RedisCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,11 @@ public function deleteMulti(array $keys)

public function removeByPattern($pattern)
{
$keysToremove = [];
$iterator = null;
while(false !== ($keys = $this->_redis->scan($iterator, $pattern))) {
$keysToremove = array_merge($keysToremove, $keys);
$this->_redis->del($keys);
}

$this->_redis->del($keysToremove);

return true;
}

Expand Down

0 comments on commit f2744ce

Please sign in to comment.