Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix: server checking status

Andras Bacsai11a957c6c912
diff --git a/app/Models/Server.php b/app/Models/Server.php
index 1ac8bbe278..a5577f6c11 100644
--- a/app/Models/Server.php
+++ b/app/Models/Server.php
@@ -153,14 +153,15 @@ class Server extends BaseModel
public function isServerReady()
{
$serverUptimeCheckNumber = $this->unreachable_count;
- $serverUptimeCheckNumberMax = 12;
+ $serverUptimeCheckNumberMax = 8;
$currentTime = now()->timestamp;
- $runtime = 65;
+ $runtime = 50;
$isReady = false;
- // Run for 65 seconds max and check every 5 seconds for 12 times
+ // Run for 50 seconds max and check every 5 seconds for 8 times
while ($currentTime + $runtime > now()->timestamp) {
+ ray('serverUptimeCheckNumber: ' . $serverUptimeCheckNumber);
if ($serverUptimeCheckNumber >= $serverUptimeCheckNumberMax) {
if ($this->unreachable_notification_sent === false) {
ray('Server unreachable, sending notification...');
@@ -200,7 +201,7 @@ class Server extends BaseModel
'unreachable_count' => $serverUptimeCheckNumber,
]);
Sleep::for(5)->seconds();
- return;
+ continue;
}
$isReady = true;
break;
diff --git a/app/Notifications/Server/Unreachable.php b/app/Notifications/Server/Unreachable.php
index 07f801fe84..fe9b46a11e 100644
--- a/app/Notifications/Server/Unreachable.php
+++ b/app/Notifications/Server/Unreachable.php
@@ -43,7 +43,7 @@ class Unreachable extends Notification implements ShouldQueue
public function toMail(): MailMessage
{
$mail = new MailMessage();
- $mail->subject("Coolify: Server ({$this->server->name}) is unreachable after trying to connect to it 3 times");
+ $mail->subject("Coolify: Your server ({$this->server->name}) is unreachable.");
$mail->view('emails.server-lost-connection', [
'name' => $this->server->name,
]);
@@ -52,13 +52,13 @@ class Unreachable extends Notification implements ShouldQueue
public function toDiscord(): string
{
- $message = "Coolify: Server '{$this->server->name}' is unreachable after trying to connect to it 3 times. All automations & integrations are turned off! Please check your server! IMPORTANT: We automatically try to revive your server. If your server is back online, we will automatically turn on all automations & integrations.";
+ $message = "Coolify: Your server '{$this->server->name}' is unreachable. All automations & integrations are turned off! Please check your server! IMPORTANT: We automatically try to revive your server. If your server is back online, we will automatically turn on all automations & integrations.";
return $message;
}
public function toTelegram(): array
{
return [
- "message" => "Coolify: Server '{$this->server->name}' is unreachable after trying to connect to it 3 times. All automations & integrations are turned off! Please check your server! IMPORTANT: We automatically try to revive your server. If your server is back online, we will automatically turn on all automations & integrations."
+ "message" => "Coolify: Your server '{$this->server->name}' is unreachable. All automations & integrations are turned off! Please check your server! IMPORTANT: We automatically try to revive your server. If your server is back online, we will automatically turn on all automations & integrations."
];
}
}