This commit is contained in:
Lee 2024-04-13 16:27:19 +01:00
parent 0b187a852c
commit 77bd9a7c7e

@ -208,13 +208,9 @@ public class MojangService {
futures.add(future); futures.add(future);
} }
CompletableFuture<Void> allFutures = CompletableFuture.allOf(futures.toArray(new CompletableFuture[0]));
//
CompletableFuture<Void> allFutures = CompletableFuture.allOf(
futures.toArray(new CompletableFuture[0]));
try { try {
allFutures.get(5, TimeUnit.SECONDS); // Timeout in 10 seconds allFutures.get(5, TimeUnit.SECONDS); // Wait for the futures to complete
} catch (Exception e) { } catch (Exception e) {
log.error("Timeout while fetching Mojang API status: {}", e.getMessage()); log.error("Timeout while fetching Mojang API status: {}", e.getMessage());
} }