From 31e08a24c960cca1e6d9a235ae5d5254754c86a4 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 9 Jan 2024 08:42:37 +0100 Subject: [PATCH] fix: healthy status --- app/Jobs/ApplicationDeploymentJob.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index 1fe0d54a3..ea5913847 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -679,7 +679,7 @@ private function health_check() "echo 'Attempt {$counter} of {$this->application->health_check_retries} | Healthcheck status: {$this->saved_outputs->get('health_check')}'" ], ); - if (Str::of($this->saved_outputs->get('health_check'))->contains('healthy')) { + if (Str::of($this->saved_outputs->get('health_check'))->replace('"', '')->value() === 'healthy') { $this->newVersionIsHealthy = true; $this->application->update(['status' => 'running']); $this->execute_remote_command( @@ -689,6 +689,10 @@ private function health_check() ); break; } + if (Str::of($this->saved_outputs->get('health_check'))->replace('"', '')->value() === 'unhealthy') { + $this->newVersionIsHealthy = false; + break; + } $counter++; sleep($this->application->health_check_interval); }