diff --git a/src/main/java/com/botdetector/http/BotDetectorClient.java b/src/main/java/com/botdetector/http/BotDetectorClient.java index d7f72838..d353acd6 100644 --- a/src/main/java/com/botdetector/http/BotDetectorClient.java +++ b/src/main/java/com/botdetector/http/BotDetectorClient.java @@ -99,12 +99,22 @@ private enum ApiPath final String path; } + /** + * {@link RuneLiteAPI#CLIENT} with a connect/read timeout of 30 seconds each and no pinging. + */ public static OkHttpClient okHttpClient = RuneLiteAPI.CLIENT.newBuilder() .pingInterval(0, TimeUnit.SECONDS) .connectTimeout(30, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) .build(); + /** + * Same as {@link #okHttpClient}, but with a read timeout of 60 seconds. + */ + public static OkHttpClient longTimeoutHttpClient = okHttpClient.newBuilder() + .readTimeout(60, TimeUnit.SECONDS) + .build(); + @Inject private GsonBuilder gsonBuilder; @@ -445,7 +455,7 @@ public CompletableFuture> requestClanRankUp .build(); CompletableFuture> future = new CompletableFuture<>(); - okHttpClient.newCall(request).enqueue(new Callback() + longTimeoutHttpClient.newCall(request).enqueue(new Callback() { @Override public void onFailure(Call call, IOException e)