Update versions and add server readiness check

This commit is contained in:
Andras Bacsai
2023-11-17 13:53:56 +01:00
parent 8c73068cc7
commit d430813230
8 changed files with 148 additions and 140 deletions

View File

@@ -48,6 +48,7 @@ class Init extends Command
private function alive()
{
$id = config('app.id');
$version = config('app.version');
$settings = InstanceSettings::get();
$do_not_track = data_get($settings, 'do_not_track');
if ($do_not_track == true) {
@@ -55,8 +56,8 @@ class Init extends Command
return;
}
try {
Http::get("https://get.coollabs.io/coolify/v4/alive?appId=$id&version=$version");
echo "I am alive!\n";
Http::get("https://get.coollabs.io/coolify/v4/alive?appId=$id");
} catch (\Throwable $e) {
echo "Error in alive: {$e->getMessage()}\n";
}

View File

@@ -35,6 +35,7 @@ class ServerStatusJob implements ShouldQueue, ShouldBeEncrypted
ray("checking server status for {$this->server->id}");
try {
if (!$this->server->checkServerRediness()) {
ray('server not ready');
return;
}
$this->cleanup(notify: false);

View File

@@ -182,6 +182,7 @@ class Server extends BaseModel
}
break;
}
return true;
}
public function getDiskUsage()
{