1
0
Fork 0
forked from mirror/pixelfed

Merge pull request #3962 from pixelfed/staging

Update MediaS3GarbageCollector command, handle thumbnail deletion
This commit is contained in:
daniel 2022-12-18 01:13:51 -07:00 committed by GitHub
commit d227e682cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -101,6 +101,9 @@ class MediaS3GarbageCollector extends Command
$totalSize = $totalSize + $media->size;
MediaService::del($media->status_id);
StatusService::del($media->status_id, false);
if($localDisk->exists($media->thumbnail_path)) {
$localDisk->delete($media->thumbnail_path);
}
} else {
$media->version = 4;
$media->save();
@ -153,6 +156,9 @@ class MediaS3GarbageCollector extends Command
$media->save();
MediaService::del($media->status_id);
StatusService::del($media->status_id, false);
if($localDisk->exists($media->thumbnail_path)) {
$localDisk->delete($media->thumbnail_path);
}
} else {
$media->version = 4;
$media->save();