refactor(application-deployment): separate handling of FAILED and CANCELLED_BY_USER statuses for clearer logic and notification
This commit is contained in:
@@ -2438,8 +2438,12 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf");
|
|||||||
queue_next_deployment($this->application);
|
queue_next_deployment($this->application);
|
||||||
|
|
||||||
// Never allow changing status from FAILED or CANCELLED_BY_USER to anything else
|
// Never allow changing status from FAILED or CANCELLED_BY_USER to anything else
|
||||||
if ($this->application_deployment_queue->status === ApplicationDeploymentStatus::FAILED->value ||
|
if ($this->application_deployment_queue->status === ApplicationDeploymentStatus::FAILED->value) {
|
||||||
$this->application_deployment_queue->status === ApplicationDeploymentStatus::CANCELLED_BY_USER->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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2447,12 +2451,6 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf");
|
|||||||
'status' => $status,
|
'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 ($status === ApplicationDeploymentStatus::FINISHED->value) {
|
||||||
if (! $this->only_this_server) {
|
if (! $this->only_this_server) {
|
||||||
$this->deploy_to_additional_destinations();
|
$this->deploy_to_additional_destinations();
|
||||||
|
|||||||
Reference in New Issue
Block a user