Skip to content

Commit

Permalink
Shrinking OkHTTP connection pool
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumBadger committed Apr 2, 2017
1 parent 10f60aa commit b754bc2
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import android.content.Context;
import okhttp3.CacheControl;
import okhttp3.Call;
import okhttp3.ConnectionPool;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.RequestBody;
Expand Down Expand Up @@ -59,6 +60,8 @@ private OKHTTPBackend() {
builder.connectTimeout(15000, TimeUnit.SECONDS);
builder.readTimeout(10000, TimeUnit.SECONDS);

builder.connectionPool(new ConnectionPool(1, 5, TimeUnit.SECONDS));

builder.retryOnConnectionFailure(true);

mClient = builder.build();
Expand Down

0 comments on commit b754bc2

Please sign in to comment.