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;
|
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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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());
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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'),
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return '4.0.0-beta.141';
|
return '4.0.0-beta.142';
|
||||||
|
|||||||
@@ -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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user