mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-28 03:57:33 +01:00
Fixed Periodic Analysis not running (#523)
This commit is contained in:
parent
207ed76a1e
commit
0270feef7a
@ -5,6 +5,7 @@ import com.djrapitops.plan.data.container.TPS;
|
|||||||
import com.djrapitops.plan.system.processing.Processor;
|
import com.djrapitops.plan.system.processing.Processor;
|
||||||
import com.djrapitops.plan.system.processing.processors.TPSInsertProcessor;
|
import com.djrapitops.plan.system.processing.processors.TPSInsertProcessor;
|
||||||
import com.djrapitops.plan.utilities.MiscUtils;
|
import com.djrapitops.plan.utilities.MiscUtils;
|
||||||
|
import com.djrapitops.plugin.api.utility.log.Log;
|
||||||
import com.djrapitops.plugin.task.AbsRunnable;
|
import com.djrapitops.plugin.task.AbsRunnable;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -20,7 +21,6 @@ public abstract class TPSCountTimer<T extends PlanPlugin> extends AbsRunnable {
|
|||||||
protected final T plugin;
|
protected final T plugin;
|
||||||
protected final List<TPS> history;
|
protected final List<TPS> history;
|
||||||
|
|
||||||
|
|
||||||
protected int latestPlayersOnline = 0;
|
protected int latestPlayersOnline = 0;
|
||||||
|
|
||||||
public TPSCountTimer(T plugin) {
|
public TPSCountTimer(T plugin) {
|
||||||
@ -31,6 +31,7 @@ public abstract class TPSCountTimer<T extends PlanPlugin> extends AbsRunnable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
try {
|
||||||
long nanoTime = System.nanoTime();
|
long nanoTime = System.nanoTime();
|
||||||
long now = MiscUtils.getTime();
|
long now = MiscUtils.getTime();
|
||||||
|
|
||||||
@ -40,6 +41,11 @@ public abstract class TPSCountTimer<T extends PlanPlugin> extends AbsRunnable {
|
|||||||
Processor.queue(new TPSInsertProcessor(new ArrayList<>(history)));
|
Processor.queue(new TPSInsertProcessor(new ArrayList<>(history)));
|
||||||
history.clear();
|
history.clear();
|
||||||
}
|
}
|
||||||
|
} catch (Exception | NoClassDefFoundError | NoSuchMethodError | NoSuchFieldError e) {
|
||||||
|
Log.error("TPS Count Task Disabled due to error, reload Plan to re-enable.");
|
||||||
|
Log.toLog(this.getClass(), e);
|
||||||
|
cancel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract void addNewTPSEntry(long nanoTime, long now);
|
public abstract void addNewTPSEntry(long nanoTime, long now);
|
||||||
|
@ -27,7 +27,9 @@ public class PeriodicAnalysisTask extends AbsRunnable {
|
|||||||
if (!PlanPlugin.getInstance().isReloading()) {
|
if (!PlanPlugin.getInstance().isReloading()) {
|
||||||
Log.toLog(this.getClass(), e);
|
Log.toLog(this.getClass(), e);
|
||||||
}
|
}
|
||||||
} finally {
|
} catch (Exception | NoClassDefFoundError | NoSuchMethodError | NoSuchFieldError e) {
|
||||||
|
Log.error("Periodic Analysis Task Disabled due to error, reload Plan to re-enable.");
|
||||||
|
Log.toLog(this.getClass(), e);
|
||||||
cancel();
|
cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user