From 6eabe07ca3e86e78964f345fad4b2e95684c0181 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 5 Dec 2022 01:09:45 -0700 Subject: [PATCH] Update DeleteAccountPipeline, dispatch on low queue --- app/Http/Controllers/SettingsController.php | 6 +++++- app/Jobs/DeletePipeline/DeleteAccountPipeline.php | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index 40691cce..9b3f03d0 100644 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -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('/'); } diff --git a/app/Jobs/DeletePipeline/DeleteAccountPipeline.php b/app/Jobs/DeletePipeline/DeleteAccountPipeline.php index 76e3b493..4ca5195c 100644 --- a/app/Jobs/DeletePipeline/DeleteAccountPipeline.php +++ b/app/Jobs/DeletePipeline/DeleteAccountPipeline.php @@ -57,6 +57,8 @@ class DeleteAccountPipeline implements ShouldQueue protected $user; + public $timeout = 900; + public function __construct(User $user) { $this->user = $user;