chore: Refactor GetContainersStatus.php for improved readability and maintainability
This commit is contained in:
parent
f6f959a897
commit
3eb4aed867
@ -52,11 +52,13 @@ public function handle()
|
||||
return;
|
||||
}
|
||||
$sentinel_found = instant_remote_process(["docker inspect coolify-sentinel"], $this->server, false);
|
||||
if ($sentinel_found) {
|
||||
raY('Sentinel');
|
||||
$sentinel_found = json_decode($sentinel_found, true);
|
||||
$status = data_get($sentinel_found, '0.State.Status', 'exited');
|
||||
if ($status === 'running') {
|
||||
ray('Sentinel');
|
||||
$this->sentinel();
|
||||
} else {
|
||||
raY('Old way');
|
||||
ray('Old way');
|
||||
$this->old_way();
|
||||
}
|
||||
}
|
||||
@ -107,7 +109,6 @@ private function sentinel()
|
||||
if ($application) {
|
||||
$foundApplications[] = $application->id;
|
||||
$statusFromDb = $application->status;
|
||||
ray($statusFromDb, $containerStatus);
|
||||
if ($statusFromDb !== $containerStatus) {
|
||||
$application->update(['status' => $containerStatus]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user