Skip to content

Commit

Permalink
Merge pull request #99 from schmittjoh/no-cache
Browse files Browse the repository at this point in the history
load cache issue in high concurrency situations
  • Loading branch information
goetas authored Aug 4, 2021
2 parents b5c5254 + 5843fe5 commit a995e6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Cache/FileCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct(string $dir)
public function load(string $class): ?ClassMetadata
{
$path = $this->getCachePath($class);
if (!file_exists($path)) {
if (!is_readable($path)) {
return null;
}

Expand All @@ -35,7 +35,7 @@ public function load(string $class): ?ClassMetadata
return $metadata;
}
// if the file does not return anything, the return value is integer `1`.
} catch (\ParseError $e) {
} catch (\Error $e) {
// ignore corrupted cache
}

Expand Down

0 comments on commit a995e6c

Please sign in to comment.