Installer followup (#519)

* remove queue worker service creation from installer

* auto check redis
This commit is contained in:
Boy132 2024-08-04 18:53:54 +02:00 committed by GitHub
parent 496eaaaf83
commit 953ee940aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 14 deletions

View File

@ -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
@ -32,7 +31,8 @@ class QueueWorkerServiceCommand extends Command
$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();

View File

@ -99,18 +99,6 @@ class PanelInstaller extends SimplePage implements HasForms
$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,