Fix server readiness check and update version

number
This commit is contained in:
Andras Bacsai
2023-11-17 14:14:13 +01:00
parent 48d7c6e76f
commit d38d50dca2
7 changed files with 5 additions and 18 deletions

View File

@@ -1022,10 +1022,6 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf");
listen [::]:80; listen [::]:80;
server_name localhost; 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 / { location / {
root /usr/share/nginx/html; root /usr/share/nginx/html;
index index.html; index index.html;

View File

@@ -39,9 +39,6 @@ class ContainerStatusJob implements ShouldQueue, ShouldBeEncrypted
{ {
// ray("checking server status for {$this->server->id}"); // ray("checking server status for {$this->server->id}");
try { try {
if (!$this->server->checkServerRediness()) {
return;
}
$containers = instant_remote_process(["docker container ls -q"], $this->server); $containers = instant_remote_process(["docker container ls -q"], $this->server);
if (!$containers) { if (!$containers) {
return; return;

View File

@@ -34,10 +34,7 @@ class ServerStatusJob implements ShouldQueue, ShouldBeEncrypted
{ {
ray("checking server status for {$this->server->id}"); ray("checking server status for {$this->server->id}");
try { try {
if (!$this->server->checkServerRediness()) { $this->server->checkServerRediness();
ray('server not ready');
return;
}
$this->cleanup(notify: false); $this->cleanup(notify: false);
} catch (\Throwable $e) { } catch (\Throwable $e) {
send_internal_notification('ServerStatusJob failed with: ' . $e->getMessage()); send_internal_notification('ServerStatusJob failed with: ' . $e->getMessage());

View File

@@ -130,9 +130,6 @@ class Server extends BaseModel
} }
public function checkServerRediness() public function checkServerRediness()
{ {
if ($this->skipServer()) {
return false;
}
$serverUptimeCheckNumber = $this->unreachable_count; $serverUptimeCheckNumber = $this->unreachable_count;
$serverUptimeCheckNumberMax = 5; $serverUptimeCheckNumberMax = 5;
@@ -168,7 +165,7 @@ class Server extends BaseModel
$db->update(['status' => 'exited']); $db->update(['status' => 'exited']);
} }
} }
return false; throw new \Exception('Server is not reachable.');
} }
$result = $this->validateConnection(); $result = $this->validateConnection();
ray('validateConnection: ' . $result); ray('validateConnection: ' . $result);

View File

@@ -7,7 +7,7 @@ return [
// The release version of your application // The release version of your application
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')) // Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
'release' => '4.0.0-beta.141', 'release' => '4.0.0-beta.142',
// When left empty or `null` the Laravel environment will be used // When left empty or `null` the Laravel environment will be used
'environment' => config('app.env'), 'environment' => config('app.env'),

View File

@@ -1,3 +1,3 @@
<?php <?php
return '4.0.0-beta.141'; return '4.0.0-beta.142';

View File

@@ -4,7 +4,7 @@
"version": "3.12.36" "version": "3.12.36"
}, },
"v4": { "v4": {
"version": "4.0.0-beta.141" "version": "4.0.0-beta.142"
} }
} }
} }