mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-22 04:53:17 +00:00
Merge pull request #3955 from pixelfed/staging
Update MediaS3GarbageCollector
This commit is contained in:
commit
823ecf7159
1 changed files with 6 additions and 0 deletions
|
@ -7,6 +7,8 @@ use App\Media;
|
||||||
use App\Status;
|
use App\Status;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
use App\Services\MediaService;
|
||||||
|
use App\Services\StatusService;
|
||||||
|
|
||||||
class MediaS3GarbageCollector extends Command
|
class MediaS3GarbageCollector extends Command
|
||||||
{
|
{
|
||||||
|
@ -94,6 +96,8 @@ class MediaS3GarbageCollector extends Command
|
||||||
$media->version = 4;
|
$media->version = 4;
|
||||||
$media->save();
|
$media->save();
|
||||||
$totalSize = $totalSize + $media->size;
|
$totalSize = $totalSize + $media->size;
|
||||||
|
MediaService::del($media->status_id);
|
||||||
|
StatusService::del($media->status_id, false);
|
||||||
} else {
|
} else {
|
||||||
$media->version = 4;
|
$media->version = 4;
|
||||||
$media->save();
|
$media->save();
|
||||||
|
@ -133,6 +137,8 @@ class MediaS3GarbageCollector extends Command
|
||||||
$localDisk->delete($media->media_path);
|
$localDisk->delete($media->media_path);
|
||||||
$media->version = 4;
|
$media->version = 4;
|
||||||
$media->save();
|
$media->save();
|
||||||
|
MediaService::del($media->status_id);
|
||||||
|
StatusService::del($media->status_id, false);
|
||||||
} else {
|
} else {
|
||||||
$media->version = 4;
|
$media->version = 4;
|
||||||
$media->save();
|
$media->save();
|
||||||
|
|
Loading…
Reference in a new issue