Fix server status check and cleanup logic
This commit is contained in:
@@ -33,11 +33,13 @@ class ServerStatusJob implements ShouldQueue, ShouldBeEncrypted
|
|||||||
public function handle(): void
|
public function handle(): void
|
||||||
{
|
{
|
||||||
ray("checking server status for {$this->server->id}");
|
ray("checking server status for {$this->server->id}");
|
||||||
|
if (!$this->server->isServerReady(4)) {
|
||||||
|
throw new \RuntimeException('Server is not reachable.');
|
||||||
|
};
|
||||||
try {
|
try {
|
||||||
if (!$this->server->isServerReady(4)) {
|
if ($this->server->isFunctional()) {
|
||||||
throw new \RuntimeException('Server is not reachable.');
|
$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());
|
||||||
ray($e->getMessage());
|
ray($e->getMessage());
|
||||||
|
|||||||
Reference in New Issue
Block a user