mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-08 12:00:19 +01:00
Start metrics async
This commit is contained in:
parent
cf9c9f7073
commit
d03d85b52b
@ -56,6 +56,7 @@ import org.bukkit.plugin.PluginDescriptionFile;
|
|||||||
import org.bukkit.plugin.PluginManager;
|
import org.bukkit.plugin.PluginManager;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.bukkit.plugin.java.JavaPluginLoader;
|
import org.bukkit.plugin.java.JavaPluginLoader;
|
||||||
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
import org.bukkit.scheduler.BukkitScheduler;
|
import org.bukkit.scheduler.BukkitScheduler;
|
||||||
import org.bukkit.scheduler.BukkitTask;
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
import org.yaml.snakeyaml.error.YAMLException;
|
import org.yaml.snakeyaml.error.YAMLException;
|
||||||
@ -205,13 +206,18 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
|
|||||||
execTimer.mark("RegHandler");
|
execTimer.mark("RegHandler");
|
||||||
|
|
||||||
if (!metrics.isOptOut()) {
|
if (!metrics.isOptOut()) {
|
||||||
try {
|
|
||||||
getLogger().info("Starting Metrics. Opt-out using the global PluginMetrics config.");
|
getLogger().info("Starting Metrics. Opt-out using the global PluginMetrics config.");
|
||||||
metrics = new MetricsLite(this);
|
new BukkitRunnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
metrics = new MetricsLite(Essentials.this);
|
||||||
metrics.start();
|
metrics.start();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// Failed to submit the stats :-(
|
// Failed to submit the stats :-(
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}.runTaskAsynchronously(this);
|
||||||
} else {
|
} else {
|
||||||
getLogger().info("Metrics disabled per PluginMetrics config.");
|
getLogger().info("Metrics disabled per PluginMetrics config.");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user