From de166bca0319f1240509f7927d2d26abb20a3b16 Mon Sep 17 00:00:00 2001 From: MartinOscar <40749467+rmartinoscar@users.noreply.github.com> Date: Sun, 8 Jun 2025 09:12:15 +0200 Subject: [PATCH] Use `supervisorctl` instead of `systemctl` when running in docker (#1378) --- .../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';