mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-12 15:56:00 +08:00
Added a 10s caching layer between database and server page creation
This commit is contained in:
parent
7e1b1fe2e8
commit
e73b89d9de
@ -9,7 +9,7 @@ import com.djrapitops.plan.api.exceptions.connection.InternalErrorException;
|
|||||||
import com.djrapitops.plan.api.exceptions.connection.WebException;
|
import com.djrapitops.plan.api.exceptions.connection.WebException;
|
||||||
import com.djrapitops.plan.api.exceptions.database.DBOpException;
|
import com.djrapitops.plan.api.exceptions.database.DBOpException;
|
||||||
import com.djrapitops.plan.data.store.containers.AnalysisContainer;
|
import com.djrapitops.plan.data.store.containers.AnalysisContainer;
|
||||||
import com.djrapitops.plan.system.database.databases.Database;
|
import com.djrapitops.plan.system.cache.CacheSystem;
|
||||||
import com.djrapitops.plan.system.info.InfoSystem;
|
import com.djrapitops.plan.system.info.InfoSystem;
|
||||||
import com.djrapitops.plan.system.info.server.ServerInfo;
|
import com.djrapitops.plan.system.info.server.ServerInfo;
|
||||||
import com.djrapitops.plan.system.webserver.pages.parsing.AnalysisPage;
|
import com.djrapitops.plan.system.webserver.pages.parsing.AnalysisPage;
|
||||||
@ -79,9 +79,7 @@ public class GenerateAnalysisPageRequest extends InfoRequestWithVariables implem
|
|||||||
try {
|
try {
|
||||||
runningAnalysis = true;
|
runningAnalysis = true;
|
||||||
UUID serverUUID = ServerInfo.getServerUUID();
|
UUID serverUUID = ServerInfo.getServerUUID();
|
||||||
Database db = Database.getActive();
|
AnalysisContainer analysisContainer = CacheSystem.getInstance().getDataContainerCache().getAnalysisContainer(serverUUID);
|
||||||
|
|
||||||
AnalysisContainer analysisContainer = new AnalysisContainer(db.fetch().getServerContainer(serverUUID));
|
|
||||||
return new AnalysisPage(analysisContainer).toHtml();
|
return new AnalysisPage(analysisContainer).toHtml();
|
||||||
} catch (DBOpException e) {
|
} catch (DBOpException e) {
|
||||||
if (!e.getCause().getMessage().contains("Connection is closed")) {
|
if (!e.getCause().getMessage().contains("Connection is closed")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user