From c796875d8c2914d8f97cfaa92bb26d194b7fa79e Mon Sep 17 00:00:00 2001 From: Liam Date: Tue, 30 Jul 2024 22:06:01 +0100 Subject: [PATCH] increase the timeout for mojang servers --- src/main/java/xyz/mcutils/backend/common/MojangServer.java | 4 ++-- .../java/xyz/mcutils/backend/controller/MojangController.java | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/xyz/mcutils/backend/common/MojangServer.java b/src/main/java/xyz/mcutils/backend/common/MojangServer.java index 3950866..50b6210 100644 --- a/src/main/java/xyz/mcutils/backend/common/MojangServer.java +++ b/src/main/java/xyz/mcutils/backend/common/MojangServer.java @@ -24,7 +24,7 @@ public enum MojangServer { LIBRARIES("Libraries Server", "https://libraries.minecraft.net"), SERVICES("Minecraft Services", "https://api.minecraftservices.com"); - private static final long STATUS_TIMEOUT = TimeUnit.SECONDS.toMillis(4); + private static final long STATUS_TIMEOUT = TimeUnit.SECONDS.toMillis(10); /** * The name of this server. @@ -58,7 +58,7 @@ public enum MojangServer { ex.printStackTrace(); } catch (IOException ignored) { // We can safely ignore any errors, we're simply checking - // if the host is reachable, if it's not, it's offline. + // if the host is reachable, if it's not, then it's offline. } return Status.OFFLINE; } diff --git a/src/main/java/xyz/mcutils/backend/controller/MojangController.java b/src/main/java/xyz/mcutils/backend/controller/MojangController.java index a65a570..f8c89ec 100644 --- a/src/main/java/xyz/mcutils/backend/controller/MojangController.java +++ b/src/main/java/xyz/mcutils/backend/controller/MojangController.java @@ -19,7 +19,6 @@ import java.util.concurrent.TimeUnit; @RequestMapping(value = "/mojang/", produces = MediaType.APPLICATION_JSON_VALUE) @Tag(name = "Mojang Controller", description = "The Mojang Controller is used to get information about the Mojang APIs.") public class MojangController { - @Autowired private MojangService mojangService;