Fixed JoinEventListener causing lag #467

This commit is contained in:
Rsl1122 2017-12-09 17:50:39 +02:00
parent b4deb1a9b4
commit dcc0e87b44

View File

@ -3,6 +3,7 @@ package main.java.com.djrapitops.plan.systems.cache;
import com.djrapitops.plugin.api.utility.log.Log; import com.djrapitops.plugin.api.utility.log.Log;
import main.java.com.djrapitops.plan.Plan; import main.java.com.djrapitops.plan.Plan;
import main.java.com.djrapitops.plan.data.container.Session; import main.java.com.djrapitops.plan.data.container.Session;
import main.java.com.djrapitops.plan.systems.processing.Processor;
import main.java.com.djrapitops.plan.utilities.MiscUtils; import main.java.com.djrapitops.plan.utilities.MiscUtils;
import java.sql.SQLException; import java.sql.SQLException;
@ -31,7 +32,12 @@ public class SessionCache {
public void cacheSession(UUID uuid, Session session) { public void cacheSession(UUID uuid, Session session) {
activeSessions.put(uuid, session); activeSessions.put(uuid, session);
plugin.getInfoManager().cachePlayer(uuid); plugin.addToProcessQueue(new Processor<Plan>(plugin) {
@Override
public void process() {
plugin.getInfoManager().cachePlayer(uuid);
}
});
} }
public void endSession(UUID uuid, long time) { public void endSession(UUID uuid, long time) {