Use supervisorctl instead of systemctl when running in docker (#1378)

This commit is contained in:
MartinOscar 2025-06-08 09:12:15 +02:00 committed by GitHub
parent af609994b6
commit de166bca03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -18,6 +18,17 @@ class QueueWorkerServiceCommand extends Command
public function handle(): void public function handle(): void
{ {
if (@file_exists('/.dockerenv')) {
$result = Process::run('supervisorctl restart queue-worker');
if ($result->failed()) {
$this->error('Error restarting service: ' . $result->errorOutput());
return;
}
$this->line('Queue worker service file updated successfully.');
return;
}
$serviceName = $this->option('service-name') ?? $this->ask('Queue worker service name', 'pelican-queue'); $serviceName = $this->option('service-name') ?? $this->ask('Queue worker service name', 'pelican-queue');
$path = '/etc/systemd/system/' . $serviceName . '.service'; $path = '/etc/systemd/system/' . $serviceName . '.service';