Removed force refresh from player page #553

This commit is contained in:
Rsl1122 2018-04-03 10:49:26 +03:00
parent a17ab55bc1
commit c25866e99a
4 changed files with 28 additions and 9 deletions

View File

@ -4,8 +4,6 @@ import com.djrapitops.plan.api.exceptions.database.DBException;
import com.djrapitops.plan.data.container.Session;
import com.djrapitops.plan.system.PlanSystem;
import com.djrapitops.plan.system.database.databases.Database;
import com.djrapitops.plan.system.info.connection.WebExceptionLogger;
import com.djrapitops.plan.system.processing.Processing;
import com.djrapitops.plan.utilities.MiscUtils;
import com.djrapitops.plugin.api.utility.log.Log;
import com.djrapitops.plugin.utilities.Verify;
@ -54,9 +52,6 @@ public class SessionCache {
public void cacheSession(UUID uuid, Session session) {
activeSessions.put(uuid, session);
Processing.submitNonCritical(() -> WebExceptionLogger.logIfOccurs(this.getClass(), () ->
system.getInfoSystem().generateAndCachePlayerPage(uuid))
);
}
public void endSession(UUID uuid, long time) {
@ -71,8 +66,6 @@ public class SessionCache {
Log.toLog(this.getClass(), e);
} finally {
activeSessions.remove(uuid);
WebExceptionLogger.logIfOccurs(this.getClass(), () -> system.getInfoSystem().generateAndCachePlayerPage(uuid));
}
}

View File

@ -4,6 +4,7 @@ import com.djrapitops.plan.data.container.Session;
import com.djrapitops.plan.system.cache.SessionCache;
import com.djrapitops.plan.system.processing.Processing;
import com.djrapitops.plan.system.processing.processors.info.NetworkPageUpdateProcessor;
import com.djrapitops.plan.system.processing.processors.info.PlayerPageUpdateProcessor;
import com.djrapitops.plan.system.processing.processors.player.*;
import com.djrapitops.plan.system.tasks.TaskSystem;
import com.djrapitops.plan.utilities.MiscUtils;
@ -99,7 +100,8 @@ public class PlayerOnlineListener implements Listener {
Processing.submit(
new RegisterProcessor(uuid, player.getFirstPlayed(), time, playerName, playersOnline,
new IPUpdateProcessor(uuid, ip, time),
new NameProcessor(uuid, playerName, displayName)
new NameProcessor(uuid, playerName, displayName),
new PlayerPageUpdateProcessor(uuid)
)
);
Processing.submit(new NetworkPageUpdateProcessor());
@ -131,6 +133,8 @@ public class PlayerOnlineListener implements Listener {
int messagesSent = sessionCache.getFirstSessionMsgCount(uuid);
Processing.submit(new FirstLeaveProcessor(uuid, time, messagesSent));
}
Processing.submit(new PlayerPageUpdateProcessor(uuid));
} catch (Exception e) {
Log.toLog(this.getClass(), e);
}

View File

@ -0,0 +1,22 @@
package com.djrapitops.plan.system.processing.processors.info;
import com.djrapitops.plan.system.info.InfoSystem;
import com.djrapitops.plan.system.info.connection.WebExceptionLogger;
import java.util.UUID;
public class PlayerPageUpdateProcessor implements Runnable {
private final UUID uuid;
public PlayerPageUpdateProcessor(UUID uuid) {
this.uuid = uuid;
}
@Override
public void run() {
WebExceptionLogger.logIfOccurs(this.getClass(),
() -> InfoSystem.getInstance().generateAndCachePlayerPage(uuid)
);
}
}

View File

@ -39,7 +39,7 @@ public class InspectPageResponse extends Response {
}
private String[] getCalculating() {
return new String[]{"<meta http-equiv=\"refresh\" content=\"5\" /><li><a><i class=\"fa fa-spin fa-refresh\"></i> Calculating...</a></li>", ""};
return new String[]{"<li><i class=\"fa fa-spin fa-refresh\"></i><a> Calculating...</a></li>", ""};
}
public static InspectPageResponse getRefreshing() {