Update Redis initialization handling now that it is multithreaded

feat/data-edit-commands
William 3 years ago
parent 7d46ce076b
commit 920d2582f5

@ -122,11 +122,6 @@ public final class HuskSyncBukkit extends JavaPlugin {
// Initialize the redis listener // Initialize the redis listener
redisListener = new BukkitRedisListener(); redisListener = new BukkitRedisListener();
if (!redisListener.isActiveAndEnabled) {
getPluginLoader().disablePlugin(this);
getLogger().severe("Failed to initialize Redis; disabling HuskSync (" + getServer().getName() + ") v" + getDescription().getVersion());
return;
}
// Ensure redis is connected; establish a handshake // Ensure redis is connected; establish a handshake
establishRedisHandshake(); establishRedisHandshake();

@ -101,10 +101,6 @@ public final class HuskSyncBungeeCord extends Plugin {
// Initialize the redis listener // Initialize the redis listener
redisListener = new BungeeRedisListener(); redisListener = new BungeeRedisListener();
if (!redisListener.isActiveAndEnabled) {
getBungeeLogger().severe("Failed to initialize Redis; HuskSync will now abort loading itself (" + getProxy().getName() + ") v" + getDescription().getVersion());
return;
}
// Register listener // Register listener
getProxy().getPluginManager().registerListener(this, new BungeeEventListener()); getProxy().getPluginManager().registerListener(this, new BungeeEventListener());

@ -72,7 +72,10 @@ public abstract class RedisListener {
log(Level.INFO, "Enabled Redis listener successfully!"); log(Level.INFO, "Enabled Redis listener successfully!");
} else { } else {
isActiveAndEnabled = false; isActiveAndEnabled = false;
log(Level.SEVERE, "Connection to the Redis server could not be established, please check the credentials."); log(Level.SEVERE, """
Failed to establish connection to the Redis server.
HuskSync will now abort initialization.
Please check the credentials are correct and restart your server.""");
return; return;
} }
jedis.subscribe(new JedisPubSub() { jedis.subscribe(new JedisPubSub() {

@ -149,10 +149,6 @@ public class HuskSyncVelocity {
// Initialize the redis listener // Initialize the redis listener
redisListener = new VelocityRedisListener(); redisListener = new VelocityRedisListener();
if (!redisListener.isActiveAndEnabled) {
getVelocityLogger().severe("Failed to initialize Redis; HuskSync will now abort loading itself (Velocity) v" + VERSION);
return;
}
// Register listener // Register listener
server.getEventManager().register(this, new VelocityEventListener()); server.getEventManager().register(this, new VelocityEventListener());

Loading…
Cancel
Save