From 429f5e55c3e33e5bbfe101b11ed3c62744ab295d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20S=C3=B6derberg?= Date: Fri, 3 Jul 2020 13:50:12 +0200 Subject: [PATCH] Add option to disable background caching --- Bukkit/src/main/java/com/plotsquared/bukkit/BukkitMain.java | 5 ++++- .../java/com/plotsquared/core/configuration/Settings.java | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitMain.java b/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitMain.java index fa969ce10..39a763d24 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitMain.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitMain.java @@ -353,7 +353,10 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain< } impromptuPipeline.storeImmediately("*", DBFunc.EVERYONE); - this.startUuidCaching(sqLiteUUIDService, cacheUUIDService); + + if (Settings.UUID.BACKGROUND_CACHING_ENABLED) { + this.startUuidCaching(sqLiteUUIDService, cacheUUIDService); + } if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) { new Placeholders().register(); diff --git a/Core/src/main/java/com/plotsquared/core/configuration/Settings.java b/Core/src/main/java/com/plotsquared/core/configuration/Settings.java index 80d103882..db22c46be 100644 --- a/Core/src/main/java/com/plotsquared/core/configuration/Settings.java +++ b/Core/src/main/java/com/plotsquared/core/configuration/Settings.java @@ -257,6 +257,9 @@ public class Settings extends Config { public static boolean LEGACY_DATABASE_SUPPORT = true; @Comment("Whether or not PlotSquared should return Unknown if it fails to fulfill a request") public static boolean UNKNOWN_AS_DEFAULT = true; + @Comment("Whether or not automatic background caching should be enabled. It is HIGHLY recommended to keep this turned on." + + " This should only be disabled if the server has a very large number of plots (>100k)") + public static boolean BACKGROUND_CACHING_ENABLED = true; }