Skip to content

Commit

Permalink
Make cache writes fail silent
Browse files Browse the repository at this point in the history
  • Loading branch information
ygottschalk committed Jun 20, 2023
1 parent 6684830 commit 503c38d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/Psalm/Internal/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Psalm\Config;
use Psalm\Internal\Provider\Providers;
use RuntimeException;

use function file_exists;
use function file_put_contents;
Expand Down Expand Up @@ -115,13 +114,10 @@ public function saveItem(string $path, $item): void
$compressed = $serialized;
}

if ($compressed === false) {
throw new RuntimeException(
'Failed to compress cache data',
);
if ($compressed !== false) {
file_put_contents($path, $compressed, LOCK_EX);
}

file_put_contents($path, $compressed, LOCK_EX);
// TODO: Error handling
}

public function getCacheDirectory(): ?string
Expand Down

0 comments on commit 503c38d

Please sign in to comment.