1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-24 16:53:17 +00:00

Update DeleteAccountPipeline, dispatch on low queue

This commit is contained in:
Daniel Supernault 2022-12-05 01:09:45 -07:00
parent da00287a8e
commit 6eabe07ca3
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
2 changed files with 7 additions and 1 deletions

View file

@ -23,6 +23,7 @@ use App\Http\Controllers\Settings\{
};
use App\Jobs\DeletePipeline\DeleteAccountPipeline;
use App\Jobs\MediaPipeline\MediaSyncLicensePipeline;
use App\Services\AccountService;
class SettingsController extends Controller
{
@ -136,6 +137,8 @@ class SettingsController extends Controller
abort_if($user->is_admin, 403);
$profile = $user->profile;
$ts = Carbon::now()->addMonth();
$user->email = $user->id;
$user->password = '';
$user->status = 'delete';
$profile->status = 'delete';
$user->delete_after = $ts;
@ -143,8 +146,9 @@ class SettingsController extends Controller
$user->save();
$profile->save();
Cache::forget('profiles:private');
AccountService::del($profile->id);
Auth::logout();
DeleteAccountPipeline::dispatch($user)->onQueue('high');
DeleteAccountPipeline::dispatch($user)->onQueue('low');
return redirect('/');
}

View file

@ -57,6 +57,8 @@ class DeleteAccountPipeline implements ShouldQueue
protected $user;
public $timeout = 900;
public function __construct(User $user)
{
$this->user = $user;