fix: sentinel
This commit is contained in:
@@ -60,6 +60,7 @@ class PushServerUpdateJob implements ShouldQueue
|
|||||||
{
|
{
|
||||||
// TODO: Handle multiple servers - done - NOT TESTED
|
// TODO: Handle multiple servers - done - NOT TESTED
|
||||||
// TODO: Handle Preview deployments - done - NOT TESTED
|
// TODO: Handle Preview deployments - done - NOT TESTED
|
||||||
|
// TODO: Emails
|
||||||
$this->containers = collect();
|
$this->containers = collect();
|
||||||
$this->foundApplicationIds = collect();
|
$this->foundApplicationIds = collect();
|
||||||
$this->foundDatabaseUuids = collect();
|
$this->foundDatabaseUuids = collect();
|
||||||
@@ -148,7 +149,10 @@ class PushServerUpdateJob implements ShouldQueue
|
|||||||
$uuid = $labels->get('com.docker.compose.service');
|
$uuid = $labels->get('com.docker.compose.service');
|
||||||
$type = $labels->get('coolify.type');
|
$type = $labels->get('coolify.type');
|
||||||
if ($name === 'coolify-proxy') {
|
if ($name === 'coolify-proxy') {
|
||||||
$this->foundProxy = true;
|
logger("Proxy: $uuid, $containerStatus");
|
||||||
|
if (str($containerStatus)->contains('running')) {
|
||||||
|
$this->foundProxy = true;
|
||||||
|
}
|
||||||
} elseif ($type === 'service') {
|
} elseif ($type === 'service') {
|
||||||
logger("Service: $uuid, $containerStatus");
|
logger("Service: $uuid, $containerStatus");
|
||||||
} else {
|
} else {
|
||||||
@@ -234,6 +238,7 @@ class PushServerUpdateJob implements ShouldQueue
|
|||||||
private function updateProxyStatus()
|
private function updateProxyStatus()
|
||||||
{
|
{
|
||||||
// If proxy is not found, start it
|
// If proxy is not found, start it
|
||||||
|
logger('Proxy not found', ['foundProxy' => $this->foundProxy, 'isProxyShouldRun' => $this->server->isProxyShouldRun()]);
|
||||||
if (! $this->foundProxy && $this->server->isProxyShouldRun()) {
|
if (! $this->foundProxy && $this->server->isProxyShouldRun()) {
|
||||||
logger('Proxy not found, starting it.');
|
logger('Proxy not found, starting it.');
|
||||||
StartProxy::dispatch($this->server);
|
StartProxy::dispatch($this->server);
|
||||||
@@ -249,12 +254,12 @@ class PushServerUpdateJob implements ShouldQueue
|
|||||||
}
|
}
|
||||||
$database->status = $containerStatus;
|
$database->status = $containerStatus;
|
||||||
$database->save();
|
$database->save();
|
||||||
|
logger('Database status updated', ['database_uuid' => $databaseUuid, 'status' => $containerStatus]);
|
||||||
if (str($containerStatus)->contains('running') && $tcpProxy) {
|
if (str($containerStatus)->contains('running') && $tcpProxy) {
|
||||||
$tcpProxyContainerFound = $this->containers->filter(function ($value, $key) use ($databaseUuid) {
|
$tcpProxyContainerFound = $this->containers->filter(function ($value, $key) use ($databaseUuid) {
|
||||||
return data_get($value, 'name') === "$databaseUuid-proxy";
|
return data_get($value, 'name') === "$databaseUuid-proxy" && data_get($value, 'state') === 'running';
|
||||||
})->first();
|
})->first();
|
||||||
|
logger('TCP proxy container found', ['tcpProxyContainerFound' => $tcpProxyContainerFound]);
|
||||||
if (! $tcpProxyContainerFound) {
|
if (! $tcpProxyContainerFound) {
|
||||||
logger('Starting TCP proxy for database', ['database_uuid' => $databaseUuid]);
|
logger('Starting TCP proxy for database', ['database_uuid' => $databaseUuid]);
|
||||||
StartDatabaseProxy::dispatch($database);
|
StartDatabaseProxy::dispatch($database);
|
||||||
|
|||||||
Reference in New Issue
Block a user