From 5d95d8b79a08cf1c5e8002f9c8be4ca11e37af9f Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 17 Oct 2023 11:10:33 +0200 Subject: [PATCH] fix: cancel any deployments + queue next --- .../Livewire/Project/Application/DeploymentNavbar.php | 8 ++++++-- .../project/application/deployment-navbar.blade.php | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/Http/Livewire/Project/Application/DeploymentNavbar.php b/app/Http/Livewire/Project/Application/DeploymentNavbar.php index b0cad0395..0cdb895c8 100644 --- a/app/Http/Livewire/Project/Application/DeploymentNavbar.php +++ b/app/Http/Livewire/Project/Application/DeploymentNavbar.php @@ -60,12 +60,16 @@ class DeploymentNavbar extends Component $previous_logs[] = $new_log_entry; $this->application_deployment_queue->update([ 'logs' => json_encode($previous_logs, flags: JSON_THROW_ON_ERROR), - 'current_process_id' => null, - 'status' => ApplicationDeploymentStatus::CANCELLED_BY_USER->value, ]); } } catch (\Throwable $e) { return handleError($e, $this); + } finally { + $this->application_deployment_queue->update([ + 'current_process_id' => null, + 'status' => ApplicationDeploymentStatus::CANCELLED_BY_USER->value, + ]); + queue_next_deployment($this->application); } } } diff --git a/resources/views/livewire/project/application/deployment-navbar.blade.php b/resources/views/livewire/project/application/deployment-navbar.blade.php index 28866083f..d42fb2298 100644 --- a/resources/views/livewire/project/application/deployment-navbar.blade.php +++ b/resources/views/livewire/project/application/deployment-navbar.blade.php @@ -7,6 +7,6 @@ @endif @if (data_get($application_deployment_queue, 'status') === 'in_progress' || data_get($application_deployment_queue, 'status') === 'queued') - Cancel deployment + Cancel Deployment @endif