Skip to content

Commit

Permalink
Update DeleteAccountPipeline, handle flysystem v3 changes by checking…
Browse files Browse the repository at this point in the history
… files exist before attempting to delete
  • Loading branch information
dansup committed Dec 5, 2022
1 parent 2214161 commit 23e2998
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions app/Jobs/DeletePipeline/DeleteAccountPipeline.php
Expand Up @@ -88,10 +88,14 @@ public function handle()
])) {
if(config('pixelfed.cloud_storage')) {
$disk = Storage::disk(config('filesystems.cloud'));
$disk->delete($path);
if($disk->exists($path)) {
$disk->delete($path);
}
}
$disk = Storage::disk(config('filesystems.local'));
$disk->delete($path);
if($disk->exists($path)) {
$disk->delete($path);
}
}

$avatar->forceDelete();
Expand Down Expand Up @@ -152,12 +156,20 @@ public function handle()
foreach($medias as $media) {
if(config('pixelfed.cloud_storage')) {
$disk = Storage::disk(config('filesystems.cloud'));
if($disk->exists($media->media_path)) {
$disk->delete($media->media_path);
}
if($disk->exists($media->thumbnail_path)) {
$disk->delete($media->thumbnail_path);
}
}
$disk = Storage::disk(config('filesystems.local'));
if($disk->exists($media->media_path)) {
$disk->delete($media->media_path);
}
if($disk->exists($media->thumbnail_path)) {
$disk->delete($media->thumbnail_path);
}
$disk = Storage::disk(config('filesystems.local'));
$disk->delete($media->media_path);
$disk->delete($media->thumbnail_path);
$media->forceDelete();
}
});
Expand Down

0 comments on commit 23e2998

Please sign in to comment.