mirror of
https://github.com/WiIIiam278/HuskSync.git
synced 2025-12-26 10:09:10 +00:00
Use JedisPool instead of single Jedis connection
This commit is contained in:
@@ -17,7 +17,6 @@ import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public final class HuskSyncBukkit extends JavaPlugin {
|
||||
@@ -32,6 +31,8 @@ public final class HuskSyncBukkit extends JavaPlugin {
|
||||
|
||||
public static BukkitDataCache bukkitCache;
|
||||
|
||||
public static BukkitRedisListener redisListener;
|
||||
|
||||
// Used for establishing a handshake with redis
|
||||
public static UUID serverUUID;
|
||||
|
||||
@@ -120,7 +121,8 @@ public final class HuskSyncBukkit extends JavaPlugin {
|
||||
getServer().getPluginManager().registerEvents(new BukkitEventListener(), this);
|
||||
|
||||
// Initialize the redis listener
|
||||
if (!new BukkitRedisListener().isActiveAndEnabled) {
|
||||
redisListener = new BukkitRedisListener();
|
||||
if (!redisListener.isActiveAndEnabled) {
|
||||
getPluginLoader().disablePlugin(this);
|
||||
getLogger().severe("Failed to initialize Redis; disabling HuskSync (" + getServer().getName() + ") v" + getDescription().getVersion());
|
||||
return;
|
||||
|
||||
@@ -26,6 +26,7 @@ public class BukkitRedisListener extends RedisListener {
|
||||
|
||||
// Initialize the listener on the bukkit server
|
||||
public BukkitRedisListener() {
|
||||
super();
|
||||
listen();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user