mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-11-09 12:20:36 +01:00
Further fixes to prevent the 404 message returned from cache even when bukkit servers are online #412
This commit is contained in:
parent
a84b470be5
commit
9c045b7b0b
@ -174,6 +174,8 @@ public class BungeeInformationManager extends InformationManager {
|
||||
try {
|
||||
getWebAPI().getAPI(IsOnlineWebAPI.class).sendRequest(server.getWebAddress(), uuid);
|
||||
return server;
|
||||
} catch (WebAPIConnectionFailException e) {
|
||||
serverInfoManager.serverHasGoneOffline(server.getUuid());
|
||||
} catch (WebAPINotFoundException ignored) {
|
||||
/*continue*/
|
||||
} catch (WebAPIException e) {
|
||||
@ -182,7 +184,7 @@ public class BungeeInformationManager extends InformationManager {
|
||||
}
|
||||
}
|
||||
|
||||
Optional<ServerInfo> bukkitServer = onlineServers.stream().findAny();
|
||||
Optional<ServerInfo> bukkitServer = serverInfoManager.getOnlineBukkitServers().stream().findAny();
|
||||
if (bukkitServer.isPresent()) {
|
||||
return bukkitServer.get();
|
||||
}
|
||||
|
@ -148,6 +148,7 @@ public class BungeeServerInfoManager {
|
||||
@Override
|
||||
public void run() {
|
||||
sendConfigSettings(serverUUID);
|
||||
connectedToServer(bukkitServers.get(serverUUID));
|
||||
this.cancel();
|
||||
}
|
||||
}).runTaskLaterAsynchronously(TimeAmount.SECOND.ticks() * 3L);
|
||||
|
@ -207,7 +207,12 @@ public class ResponseHandler extends APIResponseHandler {
|
||||
}
|
||||
|
||||
plugin.getInfoManager().cachePlayer(uuid);
|
||||
return PageCache.loadPage("inspectPage: " + uuid, () -> new InspectPageResponse(plugin.getInfoManager(), uuid));
|
||||
Response response = PageCache.loadPage("inspectPage: " + uuid);
|
||||
if (response == null || response instanceof NotFoundResponse) {
|
||||
PageCache.cachePage("inspectPage: " + uuid, () -> new InspectPageResponse(plugin.getInfoManager(), uuid));
|
||||
response = PageCache.loadPage("inspectPage: " + uuid);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
private Response notFoundResponse() {
|
||||
|
Loading…
Reference in New Issue
Block a user