mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-08-21 20:22:45 +02:00
[Fix] Fixed Analysis Page Caching
Network Page Update Processor was removing the finished analysis right after it finished.
This commit is contained in:
parent
5411fdfead
commit
e7b2770295
|
@ -82,7 +82,6 @@ public class CacheAnalysisPageRequest extends InfoRequestWithVariables implement
|
|||
|
||||
private void cache(UUID serverUUID, String html) {
|
||||
ResponseCache.cacheResponse(PageId.SERVER.of(serverUUID), () -> new AnalysisPageResponse(html));
|
||||
processing.submitNonCritical(processors.info().networkPageUpdateProcessor());
|
||||
|
||||
if (config.isTrue(Settings.ANALYSIS_EXPORT)) {
|
||||
processing.submitNonCritical(() -> htmlExport.exportServer(serverUUID));
|
||||
|
|
|
@ -135,7 +135,6 @@ public class PlayerOnlineListener implements Listener {
|
|||
processors.info().playerPageUpdateProcessor(uuid)
|
||||
)
|
||||
).runTaskAsynchronously();
|
||||
processing.submit(processors.info().networkPageUpdateProcessor());
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
|
@ -156,7 +155,6 @@ public class PlayerOnlineListener implements Listener {
|
|||
|
||||
processing.submit(processors.player().banAndOpProcessor(uuid, player::isBanned, player.isOp()));
|
||||
processing.submit(processors.player().endSessionProcessor(uuid, time));
|
||||
processing.submit(processors.info().networkPageUpdateProcessor());
|
||||
processing.submit(processors.info().playerPageUpdateProcessor(uuid));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -136,7 +136,6 @@ public class SpongePlayerListener {
|
|||
processors.info().playerPageUpdateProcessor(uuid)
|
||||
)
|
||||
).runTaskAsynchronously();
|
||||
processing.submit(processors.info().networkPageUpdateProcessor());
|
||||
}
|
||||
|
||||
@Listener(order = Order.POST)
|
||||
|
@ -158,7 +157,6 @@ public class SpongePlayerListener {
|
|||
boolean banned = isBanned(player.getProfile());
|
||||
processing.submit(processors.player().banAndOpProcessor(uuid, () -> banned, false));
|
||||
processing.submit(processors.player().endSessionProcessor(uuid, time));
|
||||
processing.submit(processors.info().networkPageUpdateProcessor());
|
||||
processing.submit(processors.info().playerPageUpdateProcessor(uuid));
|
||||
}
|
||||
}
|
|
@ -2,7 +2,6 @@ package com.djrapitops.plan.system.processing.processors.info;
|
|||
|
||||
import com.djrapitops.plan.system.info.InfoSystem;
|
||||
import com.djrapitops.plan.system.info.connection.WebExceptionLogger;
|
||||
import com.djrapitops.plan.system.info.server.ServerInfo;
|
||||
import com.djrapitops.plugin.command.Sender;
|
||||
import com.djrapitops.plugin.task.RunnableFactory;
|
||||
import dagger.Lazy;
|
||||
|
@ -20,18 +19,16 @@ import java.util.function.BiConsumer;
|
|||
@Singleton
|
||||
public class InfoProcessors {
|
||||
|
||||
private final Lazy<ServerInfo> serverInfo;
|
||||
private final Lazy<InfoSystem> infoSystem;
|
||||
private final Lazy<WebExceptionLogger> webExceptionLogger;
|
||||
private final Lazy<RunnableFactory> runnableFactory;
|
||||
|
||||
@Inject
|
||||
public InfoProcessors(
|
||||
Lazy<ServerInfo> serverInfo, Lazy<InfoSystem> infoSystem,
|
||||
Lazy<InfoSystem> infoSystem,
|
||||
Lazy<WebExceptionLogger> webExceptionLogger,
|
||||
Lazy<RunnableFactory> runnableFactory
|
||||
) {
|
||||
this.serverInfo = serverInfo;
|
||||
this.infoSystem = infoSystem;
|
||||
this.webExceptionLogger = webExceptionLogger;
|
||||
this.runnableFactory = runnableFactory;
|
||||
|
@ -48,10 +45,6 @@ public class InfoProcessors {
|
|||
);
|
||||
}
|
||||
|
||||
public NetworkPageUpdateProcessor networkPageUpdateProcessor() {
|
||||
return new NetworkPageUpdateProcessor(serverInfo.get());
|
||||
}
|
||||
|
||||
public PlayerPageUpdateProcessor playerPageUpdateProcessor(UUID uuid) {
|
||||
return new PlayerPageUpdateProcessor(uuid,
|
||||
infoSystem.get(), webExceptionLogger.get(), runnableFactory.get()
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* License is provided in the jar as LICENSE also here:
|
||||
* https://github.com/Rsl1122/Plan-PlayerAnalytics/blob/master/Plan/src/main/resources/LICENSE
|
||||
*/
|
||||
package com.djrapitops.plan.system.processing.processors.info;
|
||||
|
||||
import com.djrapitops.plan.system.info.server.ServerInfo;
|
||||
import com.djrapitops.plan.system.webserver.cache.PageId;
|
||||
import com.djrapitops.plan.system.webserver.cache.ResponseCache;
|
||||
|
||||
/**
|
||||
* Processor for updating the network page.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
public class NetworkPageUpdateProcessor implements Runnable {
|
||||
|
||||
private final ServerInfo serverInfo;
|
||||
|
||||
NetworkPageUpdateProcessor(
|
||||
ServerInfo serverInfo
|
||||
) {
|
||||
this.serverInfo = serverInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
ResponseCache.clearResponse(PageId.SERVER.of(serverInfo.getServerUUID()));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user