diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index 93dad8e8a..022368548 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -166,10 +166,6 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted public function handle(): void { - $this->application_deployment_queue->update([ - 'status' => ApplicationDeploymentStatus::IN_PROGRESS->value, - ]); - // Generate custom host<->ip mapping $allContainers = instant_remote_process(["docker network inspect {$this->destination->network} -f '{{json .Containers}}' "], $this->server); if (!is_null($allContainers)) { diff --git a/bootstrap/helpers/applications.php b/bootstrap/helpers/applications.php index de381212f..5e0040872 100644 --- a/bootstrap/helpers/applications.php +++ b/bootstrap/helpers/applications.php @@ -1,5 +1,6 @@ update([ + 'status' => ApplicationDeploymentStatus::IN_PROGRESS->value, + ]); dispatch(new ApplicationDeploymentJob( application_deployment_queue_id: $deployment->id, )); @@ -40,6 +44,9 @@ function queue_next_deployment(Application $application) $server_id = $application->destination->server_id; $next_found = ApplicationDeploymentQueue::where('server_id', $server_id)->where('status', 'queued')->get()->sortBy('created_at')->first(); if ($next_found) { + $next_found->update([ + 'status' => ApplicationDeploymentStatus::IN_PROGRESS->value, + ]); dispatch(new ApplicationDeploymentJob( application_deployment_queue_id: $next_found->id, ));