Skip to content

Commit

Permalink
Installer followup (#519)
Browse files Browse the repository at this point in the history
* remove queue worker service creation from installer

* auto check redis
  • Loading branch information
Boy132 authored Aug 4, 2024
1 parent 496eaaa commit 953ee94
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class QueueWorkerServiceCommand extends Command
{--service-name= : Name of the queue worker service.}
{--user= : The user that PHP runs under.}
{--group= : The group that PHP runs under.}
{--use-redis : Whether redis is used.}
{--overwrite : Force overwrite if the service file already exists.}';

public function handle(): void
Expand All @@ -32,7 +31,8 @@ public function handle(): void
$user = $this->option('user') ?? $this->ask('Webserver User', 'www-data');
$group = $this->option('group') ?? $this->ask('Webserver Group', 'www-data');

$afterRedis = $this->option('use-redis') ? '
$redisUsed = config('queue.default') === 'redis' || config('session.driver') === 'redis' || config('cache.default') === 'redis';
$afterRedis = $redisUsed ? '
After=redis-server.service' : '';

$basePath = base_path();
Expand Down
12 changes: 0 additions & 12 deletions app/Filament/Pages/Installer/PanelInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,6 @@ public function submit()
$variables = array_get($inputs, 'env');
$this->writeToEnvironment($variables);

$redisUsed = count(collect($variables)->filter(function ($item) {
return $item === 'redis';
})) !== 0;

// Create queue worker service (if needed)
if ($variables['QUEUE_CONNECTION'] !== 'sync') {
Artisan::call('p:environment:queue-service', [
'--use-redis' => $redisUsed,
'--overwrite' => true,
]);
}

// Run migrations
Artisan::call('migrate', [
'--force' => true,
Expand Down

0 comments on commit 953ee94

Please sign in to comment.