Flush cache before resize:make artisan command
This commit is contained in:
parent
4ca17d1065
commit
ca9b03f36a
|
@ -40,4 +40,9 @@ class CacheManager
|
|||
return "resizer.{$size}.{$normalPath}";
|
||||
}
|
||||
|
||||
public function flush(): void
|
||||
{
|
||||
Cache::tags('resizer')->flush();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?php namespace Aweos\Resizer\Console;
|
||||
|
||||
use Aweos\Resizer\Classes\CacheManager;
|
||||
use Aweos\Resizer\Classes\ResizeJob;
|
||||
use Aweos\Resizer\Models\Setting;
|
||||
use GuzzleHttp\Client;
|
||||
|
@ -42,11 +43,12 @@ class ResizeMake extends Command
|
|||
* Execute the console command.
|
||||
* @return void
|
||||
*/
|
||||
public function handle()
|
||||
public function handle(CacheManager $cacheManager)
|
||||
{
|
||||
$this->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']);
|
||||
|
|
Loading…
Reference in New Issue