Add unreachable notification when server is unreachable in Server.php

This commit is contained in:
Andras Bacsai 2024-05-03 10:49:12 +02:00
parent 3f9833117e
commit a8ddf4c2df

View File

@ -762,6 +762,11 @@ public function validateConnection()
$server->settings()->update([ $server->settings()->update([
'is_reachable' => false, 'is_reachable' => false,
]); ]);
if (data_get($server, 'unreachable_notification_sent') === false) {
ray('Server unreachable, sending notification...');
$this->team?->notify(new Unreachable($this));
$this->update(['unreachable_notification_sent' => true]);
}
return ['uptime' => false, 'error' => $e->getMessage()]; return ['uptime' => false, 'error' => $e->getMessage()];
} }
} }