From 7c4a722d722966fda17c76bc3dbeef7d353e1407 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 10 Jul 2024 15:53:56 +0200 Subject: [PATCH] refactor: Add force parameter to StartProxy handle method --- app/Actions/Proxy/StartProxy.php | 4 ++-- app/Livewire/Server/Proxy/Deploy.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Actions/Proxy/StartProxy.php b/app/Actions/Proxy/StartProxy.php index 341186bec..991c94b11 100644 --- a/app/Actions/Proxy/StartProxy.php +++ b/app/Actions/Proxy/StartProxy.php @@ -11,11 +11,11 @@ class StartProxy { use AsAction; - public function handle(Server $server, bool $async = true): string|Activity + public function handle(Server $server, bool $async = true, bool $force = false): string|Activity { try { $proxyType = $server->proxyType(); - if (is_null($proxyType) || $proxyType === 'NONE' || $server->proxy->force_stop || $server->isBuildServer()) { + if ((is_null($proxyType) || $proxyType === 'NONE' || $server->proxy->force_stop || $server->isBuildServer()) && $force === false) { return 'OK'; } $commands = collect([]); diff --git a/app/Livewire/Server/Proxy/Deploy.php b/app/Livewire/Server/Proxy/Deploy.php index 6d3f00dc8..965c51e2d 100644 --- a/app/Livewire/Server/Proxy/Deploy.php +++ b/app/Livewire/Server/Proxy/Deploy.php @@ -84,7 +84,7 @@ public function startProxy() try { $this->server->proxy->force_stop = false; $this->server->save(); - $activity = StartProxy::run($this->server); + $activity = StartProxy::run($this->server, force: true); $this->dispatch('activityMonitor', $activity->id, ProxyStatusChanged::class); } catch (\Throwable $e) { return handleError($e, $this);