refactor(deployment): streamline next deployment queuing logic by repositioning queue_next_deployment call
This commit is contained in:
parent
f18dff186d
commit
d10e4fa388
2 changed files with 2 additions and 4 deletions
|
|
@ -2457,8 +2457,6 @@ private function run_post_deployment_command()
|
|||
|
||||
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 @@ private function next(string $status)
|
|||
'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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue