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 745f06f commit 9ddf1ac
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Psalm/Internal/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,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 9ddf1ac

Please sign in to comment.