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

try to fix #40

This commit is contained in:
Tux 2016-06-26 04:19:10 -04:00
parent c753bfa983
commit 8f38b5ddb8
2 changed files with 10 additions and 14 deletions

View File

@ -90,14 +90,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>javadoc</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

View File

@ -27,12 +27,9 @@ import redis.clients.jedis.*;
import redis.clients.jedis.exceptions.JedisConnectionException;
import java.io.*;
import java.lang.reflect.Field;
import java.util.*;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
@ -225,7 +222,14 @@ public final class RedisBungee extends Plugin {
@Override
public void onEnable() {
((ThreadPoolExecutor) getExecutorService()).setMaximumPoolSize(32);
ThreadFactory factory = ((ThreadPoolExecutor) getExecutorService()).getThreadFactory();
try {
Field field = this.getClass().getDeclaredField("executorService");
field.setAccessible(true);
field.set(this, Executors.newFixedThreadPool(24, factory));
} catch (Exception e) {
}
try {
loadConfig();
} catch (IOException e) {