mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2025-04-20 01:27:07 +00:00
parent
4707fb79be
commit
436949b8d8
2
pom.xml
2
pom.xml
@ -112,7 +112,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.commons</groupId>
|
<groupId>org.apache.commons</groupId>
|
||||||
<artifactId>commons-pool2</artifactId>
|
<artifactId>commons-pool2</artifactId>
|
||||||
<version>2.3</version>
|
<version>2.4.2</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -427,19 +427,10 @@ public final class RedisBungee extends Plugin {
|
|||||||
FutureTask<JedisPool> task = new FutureTask<>(new Callable<JedisPool>() {
|
FutureTask<JedisPool> task = new FutureTask<>(new Callable<JedisPool>() {
|
||||||
@Override
|
@Override
|
||||||
public JedisPool call() throws Exception {
|
public JedisPool call() throws Exception {
|
||||||
// With recent versions of Jedis, we must set the classloader to the one BungeeCord used
|
|
||||||
// to load RedisBungee with.
|
|
||||||
ClassLoader previous = Thread.currentThread().getContextClassLoader();
|
|
||||||
Thread.currentThread().setContextClassLoader(RedisBungee.class.getClassLoader());
|
|
||||||
|
|
||||||
// Create the pool...
|
// Create the pool...
|
||||||
JedisPoolConfig config = new JedisPoolConfig();
|
JedisPoolConfig config = new JedisPoolConfig();
|
||||||
config.setMaxTotal(configuration.getInt("max-redis-connections", 8));
|
config.setMaxTotal(configuration.getInt("max-redis-connections", 8));
|
||||||
JedisPool pool = new JedisPool(config, redisServer, redisPort, 0, finalRedisPassword);
|
return new JedisPool(config, redisServer, redisPort, 0, finalRedisPassword);
|
||||||
|
|
||||||
// Reset classloader and return the pool
|
|
||||||
Thread.currentThread().setContextClassLoader(previous);
|
|
||||||
return pool;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user