mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-19 21:11:26 +00:00
Merge pull request #3962 from pixelfed/staging
Update MediaS3GarbageCollector command, handle thumbnail deletion
This commit is contained in:
commit
d227e682cd
1 changed files with 6 additions and 0 deletions
|
@ -101,6 +101,9 @@ class MediaS3GarbageCollector extends Command
|
||||||
$totalSize = $totalSize + $media->size;
|
$totalSize = $totalSize + $media->size;
|
||||||
MediaService::del($media->status_id);
|
MediaService::del($media->status_id);
|
||||||
StatusService::del($media->status_id, false);
|
StatusService::del($media->status_id, false);
|
||||||
|
if($localDisk->exists($media->thumbnail_path)) {
|
||||||
|
$localDisk->delete($media->thumbnail_path);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$media->version = 4;
|
$media->version = 4;
|
||||||
$media->save();
|
$media->save();
|
||||||
|
@ -153,6 +156,9 @@ class MediaS3GarbageCollector extends Command
|
||||||
$media->save();
|
$media->save();
|
||||||
MediaService::del($media->status_id);
|
MediaService::del($media->status_id);
|
||||||
StatusService::del($media->status_id, false);
|
StatusService::del($media->status_id, false);
|
||||||
|
if($localDisk->exists($media->thumbnail_path)) {
|
||||||
|
$localDisk->delete($media->thumbnail_path);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$media->version = 4;
|
$media->version = 4;
|
||||||
$media->save();
|
$media->save();
|
||||||
|
|
Loading…
Reference in a new issue