woop! fix timeouts and use hostnames for mojang api and session server

This commit is contained in:
Lee 2024-04-19 17:52:16 +01:00
parent 7ecaf8c580
commit aa69970ec7

View File

@ -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;
}