mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-23 06:51:27 +00:00
Update DeleteAccountPipeline, handle flysystem v3 changes by checking files exist before attempting to delete
This commit is contained in:
parent
22141618c1
commit
23e2998f94
1 changed files with 18 additions and 6 deletions
|
@ -88,10 +88,14 @@ class DeleteAccountPipeline implements ShouldQueue
|
||||||
])) {
|
])) {
|
||||||
if(config('pixelfed.cloud_storage')) {
|
if(config('pixelfed.cloud_storage')) {
|
||||||
$disk = Storage::disk(config('filesystems.cloud'));
|
$disk = Storage::disk(config('filesystems.cloud'));
|
||||||
$disk->delete($path);
|
if($disk->exists($path)) {
|
||||||
|
$disk->delete($path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$disk = Storage::disk(config('filesystems.local'));
|
$disk = Storage::disk(config('filesystems.local'));
|
||||||
$disk->delete($path);
|
if($disk->exists($path)) {
|
||||||
|
$disk->delete($path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$avatar->forceDelete();
|
$avatar->forceDelete();
|
||||||
|
@ -152,12 +156,20 @@ class DeleteAccountPipeline implements ShouldQueue
|
||||||
foreach($medias as $media) {
|
foreach($medias as $media) {
|
||||||
if(config('pixelfed.cloud_storage')) {
|
if(config('pixelfed.cloud_storage')) {
|
||||||
$disk = Storage::disk(config('filesystems.cloud'));
|
$disk = Storage::disk(config('filesystems.cloud'));
|
||||||
$disk->delete($media->media_path);
|
if($disk->exists($media->media_path)) {
|
||||||
$disk->delete($media->thumbnail_path);
|
$disk->delete($media->media_path);
|
||||||
|
}
|
||||||
|
if($disk->exists($media->thumbnail_path)) {
|
||||||
|
$disk->delete($media->thumbnail_path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$disk = Storage::disk(config('filesystems.local'));
|
$disk = Storage::disk(config('filesystems.local'));
|
||||||
$disk->delete($media->media_path);
|
if($disk->exists($media->media_path)) {
|
||||||
$disk->delete($media->thumbnail_path);
|
$disk->delete($media->media_path);
|
||||||
|
}
|
||||||
|
if($disk->exists($media->thumbnail_path)) {
|
||||||
|
$disk->delete($media->thumbnail_path);
|
||||||
|
}
|
||||||
$media->forceDelete();
|
$media->forceDelete();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue