Skip to content

Commit

Permalink
minor #25078 [FrameworkBundle] Ignore failures when removing the old …
Browse files Browse the repository at this point in the history
…cache dir (nicolas-grekas)

This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] Ignore failures when removing the old cache dir

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #25066
| License       | MIT
| Doc PR        | -

ping @phoenixgao can you please check if this improves the situation?

Commits
-------

3c4d168 [FrameworkBundle] Ignore failures when removing the old cache dir
  • Loading branch information
fabpot committed Nov 21, 2017
2 parents eba50ed + 3c4d168 commit a76489b
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -16,6 +16,7 @@
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\Filesystem\Exception\IOException;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpKernel\CacheClearer\CacheClearerInterface;
use Symfony\Component\HttpKernel\KernelInterface;
Expand Down Expand Up @@ -130,7 +131,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
$io->comment('Removing old cache directory...');
}

$this->filesystem->remove($oldCacheDir);
try {
$this->filesystem->remove($oldCacheDir);
} catch (IOException $e) {
$io->warning($e->getMessage());
}

if ($output->isVerbose()) {
$io->comment('Finished');
Expand Down

0 comments on commit a76489b

Please sign in to comment.