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