Skip to content

Commit

Permalink
only delete redis cache when you have matches
Browse files Browse the repository at this point in the history
  • Loading branch information
JRSaunders committed Jul 20, 2020
1 parent 4425363 commit f9c1b3c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/PdoCacheRedis.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ public function scanAndClean( string $key ): array {
$matches[] = $this->prefixKey( $matchKey );
$results[] = $this->read( $matchKey );
}

$this->redis->del( $matches );

if($matches) {
$this->redis->del( $matches );
}
return $results;
}

Expand Down

0 comments on commit f9c1b3c

Please sign in to comment.