mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2024-12-23 02:28:01 +00:00
add log option, check connection for JedisPooled
This commit is contained in:
parent
d77e909e7d
commit
2ae9b5d480
@ -109,6 +109,7 @@ public interface ConfigLoader {
|
||||
config.setMaxTotal(node.getNode("compatibility-max-connections").getInt(3));
|
||||
config.setBlockWhenExhausted(true);
|
||||
jedisPool = new JedisPool(config, redisServer, redisPort, 0, redisPassword, useSSL);
|
||||
plugin.logInfo("Compatibility JedisPool was created");
|
||||
}
|
||||
GenericObjectPoolConfig<Connection> poolConfig = new GenericObjectPoolConfig<>();
|
||||
poolConfig.setMaxTotal(maxConnections);
|
||||
|
@ -14,10 +14,16 @@ public class JedisPooledSummoner implements Summoner<JedisPooled> {
|
||||
public JedisPooledSummoner(JedisPooled jedisPooled, JedisPool jedisPool) {
|
||||
this.jedisPooled = jedisPooled;
|
||||
this.jedisPool = jedisPool;
|
||||
try (Jedis jedis = this.jedisPool.getResource()) {
|
||||
// Test the connection to make sure configuration is right
|
||||
jedis.ping();
|
||||
// test connections
|
||||
if (jedisPool != null) {
|
||||
try (Jedis jedis = this.jedisPool.getResource()) {
|
||||
// Test the connection to make sure configuration is right
|
||||
jedis.ping();
|
||||
}
|
||||
}
|
||||
jedisPooled.set("random_data", "0");
|
||||
jedisPooled.del("random_data");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user