From 9c2421c5fd77adea4a1f6ff9c56528a96c6d358f Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 17 Dec 2022 22:25:57 -0700 Subject: [PATCH] Update MediaS3GarbageCollector --- app/Console/Commands/MediaS3GarbageCollector.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Console/Commands/MediaS3GarbageCollector.php b/app/Console/Commands/MediaS3GarbageCollector.php index 13313aa8..db52937f 100644 --- a/app/Console/Commands/MediaS3GarbageCollector.php +++ b/app/Console/Commands/MediaS3GarbageCollector.php @@ -7,6 +7,8 @@ use App\Media; use App\Status; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Storage; +use App\Services\MediaService; +use App\Services\StatusService; class MediaS3GarbageCollector extends Command { @@ -94,6 +96,8 @@ class MediaS3GarbageCollector extends Command $media->version = 4; $media->save(); $totalSize = $totalSize + $media->size; + MediaService::del($media->status_id); + StatusService::del($media->status_id, false); } else { $media->version = 4; $media->save(); @@ -133,6 +137,8 @@ class MediaS3GarbageCollector extends Command $localDisk->delete($media->media_path); $media->version = 4; $media->save(); + MediaService::del($media->status_id); + StatusService::del($media->status_id, false); } else { $media->version = 4; $media->save();