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
@ -27,7 +27,7 @@
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.7.0</version>
|
||||
<version>3.7.0</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
@ -96,7 +96,7 @@
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.0.2</version>
|
||||
<version>3.0.2</version>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>**/test/*</exclude>
|
||||
@ -109,7 +109,7 @@
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<version>0.8.0</version>
|
||||
<version>0.8.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||
@ -198,7 +198,7 @@
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.12.2-R0.1-SNAPSHOT</version>
|
||||
<version>1.12.2-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
@ -286,7 +286,7 @@
|
||||
<dependency>
|
||||
<groupId>org.spongepowered</groupId>
|
||||
<artifactId>spongeapi</artifactId>
|
||||
<version>7.0.0</version>
|
||||
<version>7.0.0</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
@ -370,7 +370,7 @@
|
||||
<dependency>
|
||||
<groupId>org.xerial</groupId>
|
||||
<artifactId>sqlite-jdbc</artifactId>
|
||||
<version>3.21.0.1</version>
|
||||
<version>3.21.0.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -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.database.DBOpException;
|
||||
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.server.ServerInfo;
|
||||
import com.djrapitops.plan.system.webserver.pages.parsing.AnalysisPage;
|
||||
@ -79,9 +79,7 @@ public class GenerateAnalysisPageRequest extends InfoRequestWithVariables implem
|
||||
try {
|
||||
runningAnalysis = true;
|
||||
UUID serverUUID = ServerInfo.getServerUUID();
|
||||
Database db = Database.getActive();
|
||||
|
||||
AnalysisContainer analysisContainer = new AnalysisContainer(db.fetch().getServerContainer(serverUUID));
|
||||
AnalysisContainer analysisContainer = CacheSystem.getInstance().getDataContainerCache().getAnalysisContainer(serverUUID);
|
||||
return new AnalysisPage(analysisContainer).toHtml();
|
||||
} catch (DBOpException e) {
|
||||
if (!e.getCause().getMessage().contains("Connection is closed")) {
|
||||
|
Loading…
Reference in New Issue
Block a user