2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2024-11-23 04:28:01 +00:00

remove leftover debug from cluster testing and handle config correctly

This commit is contained in:
mohammed jasem alaajel 2022-07-17 08:31:55 +04:00
parent 319b5eb553
commit 36136d0c0f

View File

@ -32,6 +32,7 @@ import net.md_5.bungee.api.plugin.Plugin;
import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.Configuration;
import net.md_5.bungee.config.ConfigurationProvider; import net.md_5.bungee.config.ConfigurationProvider;
import net.md_5.bungee.config.YamlConfiguration; import net.md_5.bungee.config.YamlConfiguration;
import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
import redis.clients.jedis.*; import redis.clients.jedis.*;
import redis.clients.jedis.exceptions.JedisConnectionException; import redis.clients.jedis.exceptions.JedisConnectionException;
@ -878,7 +879,9 @@ public class RedisBungeeBungeePlugin extends Plugin implements RedisBungeePlugin
if (redisServer != null && !redisServer.isEmpty()) { if (redisServer != null && !redisServer.isEmpty()) {
if (yamlConfiguration.getBoolean("cluster-mode-enabled", false)) { if (yamlConfiguration.getBoolean("cluster-mode-enabled", false)) {
this.jedisSummoner = new ClusterJedisSummoner(new JedisCluster(new HostAndPort("192.168.0.150", 7000))); GenericObjectPoolConfig<Connection> poolConfig = new GenericObjectPoolConfig<>();
poolConfig.setMaxTotal(yamlConfiguration.getInt("max-redis-connections", 8));
this.jedisSummoner = new ClusterJedisSummoner(new JedisCluster(new HostAndPort(redisServer, redisPort), 5000, 5000, 60, serverId, redisPassword, poolConfig, useSSL));
this.redisBungeeMode = RedisBungeeMode.CLUSTER; this.redisBungeeMode = RedisBungeeMode.CLUSTER;
getLogger().log(Level.INFO, "RedisBungee MODE: CLUSTER"); getLogger().log(Level.INFO, "RedisBungee MODE: CLUSTER");
} else { } else {