8000 [Cache] Fix success interpretation when pruning cache · symfony/symfony@76a2e62 · GitHub
[go: up one dir, main page]

Skip to content

Commit 76a2e62

Browse files
committed
[Cache] Fix success interpretation when pruning cache
1 parent 867f025 commit 76a2e62

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Component/Cache/Adapter/PhpFilesAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function prune()
8282
}
8383

8484
if ($time >= $expiresAt) {
85-
$pruned = $this->doUnlink($file) && !file_exists($file) && $pruned;
85+
$pruned = ($this->doUnlink($file) || !file_exists($file)) && $pruned;
8686
}
8787
}
8888
} finally {

src/Symfony/Component/Cache/Traits/FilesystemTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function prune()
4040

4141
if (($expiresAt = (int) fgets($h)) && $time >= $expiresAt) {
4242
fclose($h);
43-
$pruned = @unlink($file) && !file_exists($file) && $pruned;
43+
$pruned = (@unlink($file) || !file_exists($file)) && $pruned;
4444
} else {
4545
fclose($h);
4646
}

0 commit comments

Comments
 (0)
0