From fcb3d71cb4c71d23f63004cf43a8dd4aefeda89a Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 20 Jun 2024 14:52:12 +0200 Subject: [PATCH] feat: add high priority queue --- app/Jobs/ApplicationDeploymentJob.php | 2 +- app/Jobs/CoolifyTask.php | 3 ++- app/Livewire/Project/Application/Heading.php | 2 +- app/Livewire/Project/Application/Previews.php | 2 +- app/Notifications/Server/Revived.php | 2 +- config/horizon.php | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index 65e9f2e93..2944b746d 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -340,7 +340,7 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue private function post_deployment() { if ($this->server->isProxyShouldRun()) { - GetContainersStatus::dispatch($this->server); + GetContainersStatus::dispatch($this->server)->onQueue('high'); // dispatch(new ContainerStatusJob($this->server)); } $this->next(ApplicationDeploymentStatus::FINISHED->value); diff --git a/app/Jobs/CoolifyTask.php b/app/Jobs/CoolifyTask.php index 5418daa22..e5f4dfd5e 100755 --- a/app/Jobs/CoolifyTask.php +++ b/app/Jobs/CoolifyTask.php @@ -23,7 +23,8 @@ class CoolifyTask implements ShouldBeEncrypted, ShouldQueue public bool $ignore_errors = false, public $call_event_on_finish = null, public $call_event_data = null - ) {} + ) { + } /** * Execute the job. diff --git a/app/Livewire/Project/Application/Heading.php b/app/Livewire/Project/Application/Heading.php index d224f4a9d..feb54c7f0 100644 --- a/app/Livewire/Project/Application/Heading.php +++ b/app/Livewire/Project/Application/Heading.php @@ -45,7 +45,7 @@ class Heading extends Component public function check_status($showNotification = false) { if ($this->application->destination->server->isFunctional()) { - GetContainersStatus::dispatch($this->application->destination->server); + GetContainersStatus::dispatch($this->application->destination->server)->onQueue('high'); // dispatch(new ContainerStatusJob($this->application->destination->server)); } else { dispatch(new ServerStatusJob($this->application->destination->server)); diff --git a/app/Livewire/Project/Application/Previews.php b/app/Livewire/Project/Application/Previews.php index f29cd43ce..df64c3fd3 100644 --- a/app/Livewire/Project/Application/Previews.php +++ b/app/Livewire/Project/Application/Previews.php @@ -186,7 +186,7 @@ class Previews extends Component instant_remote_process(["docker rm -f $name"], $this->application->destination->server, throwError: false); } } - GetContainersStatus::dispatchSync($this->application->destination->server); + GetContainersStatus::dispatchSync($this->application->destination->server)->onQueue('high'); $this->dispatch('reloadWindow'); } catch (\Throwable $e) { return handleError($e, $this); diff --git a/app/Notifications/Server/Revived.php b/app/Notifications/Server/Revived.php index e7d3baf3e..8eaadf359 100644 --- a/app/Notifications/Server/Revived.php +++ b/app/Notifications/Server/Revived.php @@ -24,7 +24,7 @@ class Revived extends Notification implements ShouldQueue if ($this->server->unreachable_notification_sent === false) { return; } - GetContainersStatus::dispatch($server); + GetContainersStatus::dispatch($server)->onQueue('high'); // dispatch(new ContainerStatusJob($server)); } diff --git a/config/horizon.php b/config/horizon.php index ef7df3f1b..939d74883 100644 --- a/config/horizon.php +++ b/config/horizon.php @@ -182,7 +182,7 @@ return [ 'defaults' => [ 's6' => [ 'connection' => 'redis', - 'queue' => ['default'], + 'queue' => ['high', 'default'], 'balance' => env('HORIZON_BALANCE', 'auto'), 'maxTime' => 0, 'maxJobs' => 0,