mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2024-11-23 04:28:01 +00:00
Force Redis >= 2.6
This commit is contained in:
parent
d691180011
commit
3102034e6b
@ -254,17 +254,15 @@ public final class RedisBungee extends Plugin {
|
|||||||
}
|
}
|
||||||
if (pool != null) {
|
if (pool != null) {
|
||||||
try (Jedis tmpRsc = pool.getResource()) {
|
try (Jedis tmpRsc = pool.getResource()) {
|
||||||
tmpRsc.hset("heartbeats", configuration.getServerId(), String.valueOf(System.currentTimeMillis()));
|
|
||||||
// This is more portable than INFO <section>
|
// This is more portable than INFO <section>
|
||||||
String info = tmpRsc.info();
|
String info = tmpRsc.info();
|
||||||
for (String s : info.split("\r\n")) {
|
for (String s : info.split("\r\n")) {
|
||||||
if (s.startsWith("redis_version:")) {
|
if (s.startsWith("redis_version:")) {
|
||||||
String version = s.split(":")[1];
|
String version = s.split(":")[1];
|
||||||
if (!(usingLua = RedisUtil.canUseLua(version))) {
|
if (!(usingLua = RedisUtil.canUseLua(version))) {
|
||||||
getLogger().warning("Your version of Redis (" + version + ") is below 2.6. RedisBungee will disable optimizations using Lua.");
|
getLogger().warning("Your version of Redis (" + version + ") is not at least version 2.6. RedisBungee requires a newer version.");
|
||||||
getLogger().warning("Support for versions of Redis below version 2.6 will be removed in the future.");
|
throw new RuntimeException("Unsupported Redis version detected");
|
||||||
} else {
|
} else {
|
||||||
getLogger().info("Using Redis >= 2.6, enabling Lua optimizations.");
|
|
||||||
LuaManager manager = new LuaManager(this);
|
LuaManager manager = new LuaManager(this);
|
||||||
serverToPlayersScript = manager.createScript(IOUtil.readInputStreamAsString(getResourceAsStream("lua/server_to_players.lua")));
|
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");
|
long uuidCacheSize = tmpRsc.hlen("uuid-cache");
|
||||||
if (uuidCacheSize > 750000) {
|
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.");
|
getLogger().info("Looks like you have a really big UUID cache! Run https://www.spigotmc.org/resources/redisbungeecleaner.8505/ as soon as possible.");
|
||||||
|
Loading…
Reference in New Issue
Block a user