Update DeleteRemoteProfile command

pull/5231/head
Daniel Supernault 2024-07-19 00:21:34 -06:00
rodzic f3b596f0c8
commit c5f85c71ae
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 23740873EE6F76A1
2 zmienionych plików z 11 dodań i 9 usunięć

Wyświetl plik

@ -2,11 +2,12 @@
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Profile;
use App\Jobs\DeletePipeline\DeleteRemoteProfilePipeline;
use function Laravel\Prompts\search;
use App\Profile;
use Illuminate\Console\Command;
use function Laravel\Prompts\confirm;
use function Laravel\Prompts\search;
class DeleteRemoteProfile extends Command
{
@ -32,18 +33,18 @@ class DeleteRemoteProfile extends Command
$id = search(
'Search for the account',
fn (string $value) => strlen($value) > 2
? Profile::whereNotNull('domain')->where('username', 'like', $value . '%')->pluck('username', 'id')->all()
? Profile::whereNotNull('domain')->where('username', 'like', $value.'%')->pluck('username', 'id')->all()
: []
);
$profile = Profile::whereNotNull('domain')->find($id);
if(!$profile) {
if (! $profile) {
$this->error('Could not find profile.');
exit;
}
$confirmed = confirm('Are you sure you want to delete ' . $profile->username . '\'s account? This action cannot be reversed.');
DeleteRemoteProfilePipeline::dispatch($profile)->onQueue('delete');
$confirmed = confirm('Are you sure you want to delete '.$profile->username.'\'s account? This action cannot be reversed.');
DeleteRemoteProfilePipeline::dispatch($profile)->onQueue('adelete');
$this->info('Dispatched delete job, it may take a few minutes...');
exit;
}

Wyświetl plik

@ -90,6 +90,7 @@ return [
'redis:story' => 30,
'redis:mmo' => 30,
'redis:intbg' => 30,
'redis:adelete' => 30,
'redis:groups' => 30,
],
@ -174,7 +175,7 @@ return [
'production' => [
'supervisor-1' => [
'connection' => 'redis',
'queue' => ['high', 'default', 'follow', 'shared', 'inbox', 'feed', 'low', 'story', 'delete', 'mmo', 'intbg', 'groups'],
'queue' => ['high', 'default', 'follow', 'shared', 'inbox', 'feed', 'low', 'story', 'delete', 'mmo', 'intbg', 'groups', 'adelete'],
'balance' => env('HORIZON_BALANCE_STRATEGY', 'auto'),
'minProcesses' => env('HORIZON_MIN_PROCESSES', 1),
'maxProcesses' => env('HORIZON_MAX_PROCESSES', 20),
@ -188,7 +189,7 @@ return [
'local' => [
'supervisor-1' => [
'connection' => 'redis',
'queue' => ['high', 'default', 'follow', 'shared', 'inbox', 'feed', 'low', 'story', 'delete', 'mmo', 'intbg', 'groups'],
'queue' => ['high', 'default', 'follow', 'shared', 'inbox', 'feed', 'low', 'story', 'delete', 'mmo', 'intbg', 'groups', 'adelete'],
'balance' => 'auto',
'minProcesses' => 1,
'maxProcesses' => 20,