mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +00:00
Update DeleteAccountPipeline
This commit is contained in:
parent
2e7b77a4c4
commit
492b92140a
2 changed files with 6 additions and 7 deletions
|
@ -78,6 +78,11 @@ class DeleteAccountPipeline implements ShouldQueue
|
|||
$user = $this->user;
|
||||
$profile = $user->profile;
|
||||
$id = $user->profile_id;
|
||||
Status::whereProfileId($id)->chunk(50, function($statuses) {
|
||||
foreach($statuses as $status) {
|
||||
StatusDelete::dispatchNow($status);
|
||||
}
|
||||
});
|
||||
$this->deleteUserColumns($user);
|
||||
AccountService::del($user->profile_id);
|
||||
|
||||
|
@ -169,12 +174,6 @@ class DeleteAccountPipeline implements ShouldQueue
|
|||
DB::table('oauth_auth_codes')->whereUserId($user->id)->delete();
|
||||
ProfileSponsor::whereProfileId($id)->delete();
|
||||
|
||||
Status::whereProfileId($id)->chunk(50, function($statuses) {
|
||||
foreach($statuses as $status) {
|
||||
StatusDelete::dispatch($status)->onQueue('high');
|
||||
}
|
||||
});
|
||||
|
||||
Report::whereUserId($user->id)->forceDelete();
|
||||
PublicTimelineService::warmCache(true, 400);
|
||||
Profile::whereUserId($user->id)->delete();
|
||||
|
|
|
@ -137,9 +137,9 @@ class StatusService
|
|||
|
||||
public static function del($id, $purge = false)
|
||||
{
|
||||
$status = self::get($id);
|
||||
|
||||
if($purge) {
|
||||
$status = self::get($id);
|
||||
if($status && isset($status['account']) && isset($status['account']['id'])) {
|
||||
Cache::forget('profile:embed:' . $status['account']['id']);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue