refactor(application-deployment): separate handling of FAILED and CANCELLED_BY_USER statuses for clearer logic and notification
This commit is contained in:
parent
05a03c44d3
commit
761da352fe
1 changed files with 6 additions and 8 deletions
|
|
@ -2438,8 +2438,12 @@ private function next(string $status)
|
||||||
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 @@ private function next(string $status)
|
||||||
'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();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue