Fix start-up & add debug to ProcessingQueue

This commit is contained in:
Rsl1122 2017-08-24 14:14:05 +03:00
parent dced471adb
commit bff67cd1e5
3 changed files with 9 additions and 14 deletions

View File

@ -159,15 +159,6 @@ public class Plan extends BukkitPlugin<Plan> {
}
Benchmark.stop("Enable", "Init Database");
Benchmark.start("Init DataCache");
infoManager = new InformationManager(this);
Benchmark.stop("Enable", "Init DataCache");
registerListeners();
this.api = new API(this);
registerTasks();
Benchmark.start("WebServer Initialization");
uiServer = new WebServer(this);
registerWebAPIs(); // TODO Move to WebServer class
@ -177,10 +168,13 @@ public class Plan extends BukkitPlugin<Plan> {
Log.error("WebServer was not successfully initialized.");
}
//TODO Re-Enable after DB ServerTable has been initialized properly.
// Benchmark.start("ServerInfo Registration");
// serverInfoManager = new ServerInfoManager(this);
// Benchmark.stop("Enable", "ServerInfo Registration");
serverInfoManager = new ServerInfoManager(this);
infoManager = new InformationManager(this);
registerListeners();
registerTasks();
this.api = new API(this);
setupFilter(); // TODO Move to RegisterCommand Constructor

View File

@ -96,7 +96,7 @@ public class PlanPlayerListener implements Listener {
cache.cacheSession(uuid, Session.start(time, world, gm));
plugin.addToProcessQueue(
new RegisterProcessor(this, uuid, player.getFirstPlayed(), playerName, playersOnline),
new RegisterProcessor(uuid, player.getFirstPlayed(), playerName, playersOnline),
new IPUpdateProcessor(uuid, ip),
new NameProcessor(uuid, playerName, displayName),
new DBCommitProcessor(plugin.getDB())

View File

@ -49,6 +49,7 @@ class ProcessConsumer extends Consumer<Processor> {
return;
}
try {
Log.debug("Processed " + process.getClass().getSimpleName() + ".");
process.process();
} catch (Exception | NoClassDefFoundError | NoSuchFieldError | NoSuchMethodError e) {
Log.toLog(this.getTaskName() + ":" + process.getClass().getSimpleName(), e);