Skip to content

Commit 8056b41

Browse files
committed
Reactively verify File caches are flushed
This change subtly adjusts how directory deletions are confirmed. The main change being that we're reactively confirming if the directory was deleted. The original code assumes that the deleteDirectory method is always going to return false when it fails. This is an incorrect assumption to make. Because the deleteDirectory method actually will only return false if the input path isn't a directory. And it will silently fail if it has issues with removal of the directory and/or it's children items.
1 parent 0aa0acf commit 8056b41

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Illuminate/Cache/FileStore.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ public function flush()
179179
}
180180

181181
foreach ($this->files->directories($this->directory) as $directory) {
182-
if (! $this->files->deleteDirectory($directory)) {
182+
$results = $this->files->deleteDirectory($directory);
183+
if (! $results || $this->files->exists($directory)) {
183184
return false;
184185
}
185186
}

0 commit comments

Comments
 (0)