2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2024-10-31 18:48:01 +00:00

Fix okhttp AccessControlException

This commit is contained in:
PunKeel 2015-03-28 21:46:08 +01:00
parent f391793e45
commit c6c73cf731

View File

@ -14,6 +14,7 @@ import com.imaginarycode.minecraft.redisbungee.events.PubSubMessageEvent;
import com.imaginarycode.minecraft.redisbungee.util.NameFetcher; import com.imaginarycode.minecraft.redisbungee.util.NameFetcher;
import com.imaginarycode.minecraft.redisbungee.util.UUIDFetcher; import com.imaginarycode.minecraft.redisbungee.util.UUIDFetcher;
import com.imaginarycode.minecraft.redisbungee.util.UUIDTranslator; import com.imaginarycode.minecraft.redisbungee.util.UUIDTranslator;
import com.squareup.okhttp.Dispatcher;
import com.squareup.okhttp.OkHttpClient; import com.squareup.okhttp.OkHttpClient;
import lombok.Getter; import lombok.Getter;
import lombok.NonNull; import lombok.NonNull;
@ -434,6 +435,8 @@ public final class RedisBungee extends Plugin {
public Void call() throws Exception { public Void call() throws Exception {
service = Executors.newFixedThreadPool(16); service = Executors.newFixedThreadPool(16);
httpClient = new OkHttpClient(); httpClient = new OkHttpClient();
Dispatcher dispatcher = new Dispatcher(service);
httpClient.setDispatcher(dispatcher);
NameFetcher.setHttpClient(httpClient); NameFetcher.setHttpClient(httpClient);
UUIDFetcher.setHttpClient(httpClient); UUIDFetcher.setHttpClient(httpClient);
return null; return null;