mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2024-11-22 20:28:00 +00:00
parent
4707fb79be
commit
436949b8d8
2
pom.xml
2
pom.xml
@ -112,7 +112,7 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-pool2</artifactId>
|
||||
<version>2.3</version>
|
||||
<version>2.4.2</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -427,19 +427,10 @@ public final class RedisBungee extends Plugin {
|
||||
FutureTask<JedisPool> task = new FutureTask<>(new Callable<JedisPool>() {
|
||||
@Override
|
||||
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...
|
||||
JedisPoolConfig config = new JedisPoolConfig();
|
||||
config.setMaxTotal(configuration.getInt("max-redis-connections", 8));
|
||||
JedisPool pool = new JedisPool(config, redisServer, redisPort, 0, finalRedisPassword);
|
||||
|
||||
// Reset classloader and return the pool
|
||||
Thread.currentThread().setContextClassLoader(previous);
|
||||
return pool;
|
||||
return new JedisPool(config, redisServer, redisPort, 0, finalRedisPassword);
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user