Don't fail silently on cache clear (#2756)

This commit is contained in:
Alexander Skvortsov 2021-04-07 22:13:08 -04:00 committed by GitHub
parent e4d5a328f3
commit 9a9a644c56

View File

@ -62,7 +62,13 @@ class CacheClearCommand extends AbstractCommand
{ {
$this->info('Clearing the cache...'); $this->info('Clearing the cache...');
$this->cache->flush(); $succeeded = $this->cache->flush();
if (! $succeeded) {
$this->error('Could not clear contents of `storage/cache`. Please adjust file permissions and try again. This can frequently be fixed by clearing cache via the `Tools` dropdown on the Administration Dashboard page.');
return 1;
}
$storagePath = $this->paths->storage; $storagePath = $this->paths->storage;
array_map('unlink', glob($storagePath.'/formatter/*')); array_map('unlink', glob($storagePath.'/formatter/*'));