[FrameworkBundle] Ignore failures when removing the old cache dir

This commit is contained in:
Nicolas Grekas 2017-11-21 11:54:42 +01:00
parent 79a64d3bd5
commit 3c4d168ca9

View File

@ -16,6 +16,7 @@ use Symfony\Component\Console\Input\InputOption;
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;
@ -130,7 +131,11 @@ EOF
$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');