From ca9b03f36adf8d6f540b44ddd90a494ace81bec6 Mon Sep 17 00:00:00 2001 From: Philipp Lang Date: Mon, 6 Sep 2021 17:47:46 +0200 Subject: [PATCH] Flush cache before resize:make artisan command --- classes/CacheManager.php | 5 +++++ console/ResizeMake.php | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/classes/CacheManager.php b/classes/CacheManager.php index 665166c..08c7b6e 100644 --- a/classes/CacheManager.php +++ b/classes/CacheManager.php @@ -40,4 +40,9 @@ class CacheManager return "resizer.{$size}.{$normalPath}"; } + public function flush(): void + { + Cache::tags('resizer')->flush(); + } + } diff --git a/console/ResizeMake.php b/console/ResizeMake.php index 7413381..5edcf0b 100644 --- a/console/ResizeMake.php +++ b/console/ResizeMake.php @@ -1,5 +1,6 @@ media = MediaLibrary::instance(); ProgressBar::setFormatDefinition('custom', '%current%/%max% %bar% -- %message% (%size%)'); Storage::deleteDirectory('uploads/public/c'); + $cacheManager->flush(); foreach (Setting::get('folders') as $folder) { $this->resize($folder['folder']);