Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

refactor(application-deployment): separate handling of FAILED and CANCELLED_BY_USER statuses for clearer logic and notification

Andras Bacsai761da352fe5d
diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php
index ad203fb1c1..2b88e35591 100644
--- a/app/Jobs/ApplicationDeploymentJob.php
+++ b/app/Jobs/ApplicationDeploymentJob.php
@@ -2438,8 +2438,12 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf");
queue_next_deployment($this->application);
// Never allow changing status from FAILED or CANCELLED_BY_USER to anything else
- if ($this->application_deployment_queue->status === ApplicationDeploymentStatus::FAILED->value ||
- $this->application_deployment_queue->status === ApplicationDeploymentStatus::CANCELLED_BY_USER->value) {
+ if ($this->application_deployment_queue->status === ApplicationDeploymentStatus::FAILED->value) {
+ $this->application->environment->project->team?->notify(new DeploymentFailed($this->application, $this->deployment_uuid, $this->preview));
+
+ return;
+ }
+ if ($this->application_deployment_queue->status === ApplicationDeploymentStatus::CANCELLED_BY_USER->value) {
return;
}
@@ -2447,12 +2451,6 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf");
'status' => $status,
]);
- if ($status === ApplicationDeploymentStatus::FAILED->value) {
- $this->application->environment->project->team?->notify(new DeploymentFailed($this->application, $this->deployment_uuid, $this->preview));
-
- return;
- }
-
if ($status === ApplicationDeploymentStatus::FINISHED->value) {
if (! $this->only_this_server) {
$this->deploy_to_additional_destinations();