refactor(deployment): streamline next deployment queuing logic by repositioning queue_next_deployment call
This commit is contained in:
@@ -2457,8 +2457,6 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf");
|
||||
|
||||
private function next(string $status)
|
||||
{
|
||||
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->environment->project->team?->notify(new DeploymentFailed($this->application, $this->deployment_uuid, $this->preview));
|
||||
@@ -2473,6 +2471,8 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf");
|
||||
'status' => $status,
|
||||
]);
|
||||
|
||||
queue_next_deployment($this->application);
|
||||
|
||||
if ($status === ApplicationDeploymentStatus::FINISHED->value) {
|
||||
if (! $this->only_this_server) {
|
||||
$this->deploy_to_additional_destinations();
|
||||
|
@@ -108,7 +108,6 @@ function queue_next_deployment(Application $application)
|
||||
ApplicationDeploymentJob::dispatch(
|
||||
application_deployment_queue_id: $next_deployment->id,
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -158,7 +157,6 @@ function next_after_cancel(?Server $server = null)
|
||||
ApplicationDeploymentJob::dispatch(
|
||||
application_deployment_queue_id: $next->id,
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user