From 7ecaf8c5806e16c4fe20a18eb3f6fd870b9f1550 Mon Sep 17 00:00:00 2001 From: Liam Date: Fri, 19 Apr 2024 17:31:20 +0100 Subject: [PATCH] lower timeout --- src/main/java/xyz/mcutils/backend/service/MojangService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/xyz/mcutils/backend/service/MojangService.java b/src/main/java/xyz/mcutils/backend/service/MojangService.java index 761b4e5..a66e24b 100644 --- a/src/main/java/xyz/mcutils/backend/service/MojangService.java +++ b/src/main/java/xyz/mcutils/backend/service/MojangService.java @@ -100,7 +100,7 @@ public class MojangService { log.info("Fetching blocked servers from Mojang"); try ( InputStream inputStream = new URL(FETCH_BLOCKED_SERVERS).openStream(); - Scanner scanner = new Scanner(inputStream, StandardCharsets.UTF_8).useDelimiter("\n"); + Scanner scanner = new Scanner(inputStream, StandardCharsets.UTF_8).useDelimiter("\n") ) { List hashes = new ArrayList<>(); while (scanner.hasNext()) { @@ -197,7 +197,7 @@ public class MojangService { try { long start = System.currentTimeMillis(); InetAddress address = InetAddress.getByName(endpoint.getHostname()); - if (address.isReachable(5000)) { // Check if the endpoint is reachable + if (address.isReachable((int) TimeUnit.SECONDS.toMillis(2))) { // Check if the endpoint is reachable endpoint.setStatus(EndpointStatus.Status.ONLINE); return; }