mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-22 04:53:17 +00:00
Merge pull request #3901 from pixelfed/staging
Update DeleteAccountPipeline, dispatch on low queue
This commit is contained in:
commit
cfc1067763
2 changed files with 7 additions and 1 deletions
|
@ -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('/');
|
||||
}
|
||||
|
||||
|
|
|
@ -57,6 +57,8 @@ class DeleteAccountPipeline implements ShouldQueue
|
|||
|
||||
protected $user;
|
||||
|
||||
public $timeout = 900;
|
||||
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
|
|
Loading…
Reference in a new issue