feat: add high priority queue

This commit is contained in:
Andras Bacsai 2024-06-20 14:52:12 +02:00
parent 93c890ce41
commit fcb3d71cb4
6 changed files with 7 additions and 6 deletions

View File

@ -340,7 +340,7 @@ private function decide_what_to_do()
private function post_deployment() private function post_deployment()
{ {
if ($this->server->isProxyShouldRun()) { if ($this->server->isProxyShouldRun()) {
GetContainersStatus::dispatch($this->server); GetContainersStatus::dispatch($this->server)->onQueue('high');
// dispatch(new ContainerStatusJob($this->server)); // dispatch(new ContainerStatusJob($this->server));
} }
$this->next(ApplicationDeploymentStatus::FINISHED->value); $this->next(ApplicationDeploymentStatus::FINISHED->value);

View File

@ -23,7 +23,8 @@ public function __construct(
public bool $ignore_errors = false, public bool $ignore_errors = false,
public $call_event_on_finish = null, public $call_event_on_finish = null,
public $call_event_data = null public $call_event_data = null
) {} ) {
}
/** /**
* Execute the job. * Execute the job.

View File

@ -45,7 +45,7 @@ public function mount()
public function check_status($showNotification = false) public function check_status($showNotification = false)
{ {
if ($this->application->destination->server->isFunctional()) { 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)); // dispatch(new ContainerStatusJob($this->application->destination->server));
} else { } else {
dispatch(new ServerStatusJob($this->application->destination->server)); dispatch(new ServerStatusJob($this->application->destination->server));

View File

@ -186,7 +186,7 @@ public function stop(int $pull_request_id)
instant_remote_process(["docker rm -f $name"], $this->application->destination->server, throwError: false); 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'); $this->dispatch('reloadWindow');
} catch (\Throwable $e) { } catch (\Throwable $e) {
return handleError($e, $this); return handleError($e, $this);

View File

@ -24,7 +24,7 @@ public function __construct(public Server $server)
if ($this->server->unreachable_notification_sent === false) { if ($this->server->unreachable_notification_sent === false) {
return; return;
} }
GetContainersStatus::dispatch($server); GetContainersStatus::dispatch($server)->onQueue('high');
// dispatch(new ContainerStatusJob($server)); // dispatch(new ContainerStatusJob($server));
} }

View File

@ -182,7 +182,7 @@
'defaults' => [ 'defaults' => [
's6' => [ 's6' => [
'connection' => 'redis', 'connection' => 'redis',
'queue' => ['default'], 'queue' => ['high', 'default'],
'balance' => env('HORIZON_BALANCE', 'auto'), 'balance' => env('HORIZON_BALANCE', 'auto'),
'maxTime' => 0, 'maxTime' => 0,
'maxJobs' => 0, 'maxJobs' => 0,