From f6c8ab2974d3fd953ac19dad912475778dfb8b1d Mon Sep 17 00:00:00 2001 From: RMartinOscar <40749467+RMartinOscar@users.noreply.github.com> Date: Wed, 14 May 2025 15:09:03 +0000 Subject: [PATCH] Use `supervisorctl` instead of `systemctl` when running in docker --- .../Environment/QueueWorkerServiceCommand.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/Console/Commands/Environment/QueueWorkerServiceCommand.php b/app/Console/Commands/Environment/QueueWorkerServiceCommand.php index 92ea88e75..23fdff40a 100644 --- a/app/Console/Commands/Environment/QueueWorkerServiceCommand.php +++ b/app/Console/Commands/Environment/QueueWorkerServiceCommand.php @@ -18,6 +18,17 @@ class QueueWorkerServiceCommand extends Command 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'); $path = '/etc/systemd/system/' . $serviceName . '.service';