Refactor application status update logic and add complex_status column

This commit is contained in:
Andras Bacsai
2024-02-06 15:42:31 +01:00
parent 3616fc8ca9
commit 78b194cb16
5 changed files with 40 additions and 12 deletions

View File

@@ -126,7 +126,16 @@ class ContainerStatusJob implements ShouldQueue, ShouldBeEncrypted
$foundApplications[] = $application->id;
$statusFromDb = $application->status;
if ($statusFromDb !== $containerStatus) {
// if ($application->additional_networks->count() > 0) {
// }
// if (!str($containerStatus)->contains('running')) {
// $application->update(['status' => 'degraded']);
// } else {
// $application->update(['status' => $containerStatus]);
// }
// } else {
$application->update(['status' => $containerStatus]);
// }
}
} else {
//Notify user that this container should not be there.
@@ -160,10 +169,9 @@ class ContainerStatusJob implements ShouldQueue, ShouldBeEncrypted
// Notify user that this container should not be there.
}
}
if (data_get($container,'Name') === '/coolify-db') {
if (data_get($container, 'Name') === '/coolify-db') {
$foundDatabases[] = 0;
}
}
$serviceLabelId = data_get($labels, 'coolify.serviceId');
if ($serviceLabelId) {