From aa69970ec77c7fba1ad8281a0f99689ea22c3015 Mon Sep 17 00:00:00 2001 From: Liam Date: Fri, 19 Apr 2024 17:52:16 +0100 Subject: [PATCH] woop! fix timeouts and use hostnames for mojang api and session server --- .../java/xyz/mcutils/backend/service/MojangService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/xyz/mcutils/backend/service/MojangService.java b/src/main/java/xyz/mcutils/backend/service/MojangService.java index a66e24b..356124e 100644 --- a/src/main/java/xyz/mcutils/backend/service/MojangService.java +++ b/src/main/java/xyz/mcutils/backend/service/MojangService.java @@ -59,8 +59,8 @@ public class MojangService { new EndpointStatus("Minecraft Libraries", "libraries.minecraft.net"), new EndpointStatus("Minecraft Services", "api.minecraftservices.com"), new EndpointStatus("Mojang Assets", "assets.mojang.com"), - new EndpointStatus("Mojang API", API_ENDPOINT), - new EndpointStatus("Mojang Session Server", SESSION_SERVER_ENDPOINT)); + new EndpointStatus("Mojang API", "api.mojang.com"), + new EndpointStatus("Mojang Session Server", "sessionserver.mojang.com")); @Autowired private EndpointStatusRepository mojangEndpointStatusRepository; @@ -197,7 +197,7 @@ public class MojangService { try { long start = System.currentTimeMillis(); InetAddress address = InetAddress.getByName(endpoint.getHostname()); - if (address.isReachable((int) TimeUnit.SECONDS.toMillis(2))) { // Check if the endpoint is reachable + if (address.isReachable((int) TimeUnit.SECONDS.toMillis(4))) { // Check if the endpoint is reachable endpoint.setStatus(EndpointStatus.Status.ONLINE); return; }