From 3102034e6b95f462aa91888081c7962691807773 Mon Sep 17 00:00:00 2001 From: Tux Date: Mon, 9 Nov 2015 14:31:36 -0500 Subject: [PATCH] Force Redis >= 2.6 --- .../imaginarycode/minecraft/redisbungee/RedisBungee.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungee.java b/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungee.java index 5c84d8e..c881967 100644 --- a/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungee.java +++ b/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungee.java @@ -254,17 +254,15 @@ public final class RedisBungee extends Plugin { } if (pool != null) { try (Jedis tmpRsc = pool.getResource()) { - tmpRsc.hset("heartbeats", configuration.getServerId(), String.valueOf(System.currentTimeMillis())); // This is more portable than INFO
String info = tmpRsc.info(); for (String s : info.split("\r\n")) { if (s.startsWith("redis_version:")) { String version = s.split(":")[1]; if (!(usingLua = RedisUtil.canUseLua(version))) { - getLogger().warning("Your version of Redis (" + version + ") is below 2.6. RedisBungee will disable optimizations using Lua."); - getLogger().warning("Support for versions of Redis below version 2.6 will be removed in the future."); + getLogger().warning("Your version of Redis (" + version + ") is not at least version 2.6. RedisBungee requires a newer version."); + throw new RuntimeException("Unsupported Redis version detected"); } else { - getLogger().info("Using Redis >= 2.6, enabling Lua optimizations."); LuaManager manager = new LuaManager(this); serverToPlayersScript = manager.createScript(IOUtil.readInputStreamAsString(getResourceAsStream("lua/server_to_players.lua"))); } @@ -272,6 +270,8 @@ public final class RedisBungee extends Plugin { } } + tmpRsc.hset("heartbeats", configuration.getServerId(), String.valueOf(System.currentTimeMillis())); + long uuidCacheSize = tmpRsc.hlen("uuid-cache"); if (uuidCacheSize > 750000) { getLogger().info("Looks like you have a really big UUID cache! Run https://www.spigotmc.org/resources/redisbungeecleaner.8505/ as soon as possible.");