2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2024-12-23 10:38:01 +00:00

Update commons-pool2 since classloader bugs are fixed

Closes #38
This commit is contained in:
Tux 2016-05-31 06:35:29 -04:00
parent 4707fb79be
commit 436949b8d8
2 changed files with 2 additions and 11 deletions

View File

@ -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>

View File

@ -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);
}
});