forked from MinecraftUtilities/Backend
woop! fix timeouts and use hostnames for mojang api and session server
This commit is contained in:
parent
7ecaf8c580
commit
aa69970ec7
@ -59,8 +59,8 @@ public class MojangService {
|
|||||||
new EndpointStatus("Minecraft Libraries", "libraries.minecraft.net"),
|
new EndpointStatus("Minecraft Libraries", "libraries.minecraft.net"),
|
||||||
new EndpointStatus("Minecraft Services", "api.minecraftservices.com"),
|
new EndpointStatus("Minecraft Services", "api.minecraftservices.com"),
|
||||||
new EndpointStatus("Mojang Assets", "assets.mojang.com"),
|
new EndpointStatus("Mojang Assets", "assets.mojang.com"),
|
||||||
new EndpointStatus("Mojang API", API_ENDPOINT),
|
new EndpointStatus("Mojang API", "api.mojang.com"),
|
||||||
new EndpointStatus("Mojang Session Server", SESSION_SERVER_ENDPOINT));
|
new EndpointStatus("Mojang Session Server", "sessionserver.mojang.com"));
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private EndpointStatusRepository mojangEndpointStatusRepository;
|
private EndpointStatusRepository mojangEndpointStatusRepository;
|
||||||
@ -197,7 +197,7 @@ public class MojangService {
|
|||||||
try {
|
try {
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
InetAddress address = InetAddress.getByName(endpoint.getHostname());
|
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);
|
endpoint.setStatus(EndpointStatus.Status.ONLINE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user