Fix server readiness check and update version
number
This commit is contained in:
@@ -1022,10 +1022,6 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf");
|
||||
listen [::]:80;
|
||||
server_name localhost;
|
||||
|
||||
// real_ip_header X-Forwarded-For;
|
||||
// proxy_set_header X-Real-IP \$remote_addr;
|
||||
// proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
@@ -39,9 +39,6 @@ class ContainerStatusJob implements ShouldQueue, ShouldBeEncrypted
|
||||
{
|
||||
// ray("checking server status for {$this->server->id}");
|
||||
try {
|
||||
if (!$this->server->checkServerRediness()) {
|
||||
return;
|
||||
}
|
||||
$containers = instant_remote_process(["docker container ls -q"], $this->server);
|
||||
if (!$containers) {
|
||||
return;
|
||||
|
||||
@@ -34,10 +34,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->server->checkServerRediness();
|
||||
$this->cleanup(notify: false);
|
||||
} catch (\Throwable $e) {
|
||||
send_internal_notification('ServerStatusJob failed with: ' . $e->getMessage());
|
||||
|
||||
@@ -130,9 +130,6 @@ class Server extends BaseModel
|
||||
}
|
||||
public function checkServerRediness()
|
||||
{
|
||||
if ($this->skipServer()) {
|
||||
return false;
|
||||
}
|
||||
$serverUptimeCheckNumber = $this->unreachable_count;
|
||||
$serverUptimeCheckNumberMax = 5;
|
||||
|
||||
@@ -168,7 +165,7 @@ class Server extends BaseModel
|
||||
$db->update(['status' => 'exited']);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
throw new \Exception('Server is not reachable.');
|
||||
}
|
||||
$result = $this->validateConnection();
|
||||
ray('validateConnection: ' . $result);
|
||||
|
||||
Reference in New Issue
Block a user