From e67f7193efc2b53d9f2907d16d4dbf4a4a59a313 Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Fri, 25 Oct 2019 15:37:17 +0300 Subject: [PATCH] Fixed network page#tab-servers using month data This caused some loading issues when network had a lot of servers --- .../plan/delivery/rendering/json/JSONFactory.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/rendering/json/JSONFactory.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/rendering/json/JSONFactory.java index 654b64326..de8a5a319 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/rendering/json/JSONFactory.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/rendering/json/JSONFactory.java @@ -160,7 +160,6 @@ public class JSONFactory { Database db = dbSystem.getDatabase(); long now = System.currentTimeMillis(); long weekAgo = now - TimeUnit.DAYS.toMillis(7L); - long monthAgo = now - TimeUnit.DAYS.toMillis(30L); Formatter year = formatters.yearLong(); Formatter decimals = formatters.decimals(); @@ -173,11 +172,11 @@ public class JSONFactory { .map(Server::getUuid).orElse(null); Map> tpsData = db.query( - TPSQueries.fetchTPSDataOfAllServersBut(monthAgo, now, proxyUUID) + TPSQueries.fetchTPSDataOfAllServersBut(weekAgo, now, proxyUUID) ); Map totalPlayerCounts = db.query(PlayerCountQueries.newPlayerCounts(0, now)); - Map newPlayerCounts = db.query(PlayerCountQueries.newPlayerCounts(monthAgo, now)); - Map uniquePlayerCounts = db.query(PlayerCountQueries.uniquePlayerCounts(monthAgo, now)); + Map newPlayerCounts = db.query(PlayerCountQueries.newPlayerCounts(weekAgo, now)); + Map uniquePlayerCounts = db.query(PlayerCountQueries.uniquePlayerCounts(weekAgo, now)); List> servers = new ArrayList<>(); serverInformation.entrySet()