Skip to content

Commit

Permalink
Set ConnectionRequestTimeout as well
Browse files Browse the repository at this point in the history
  • Loading branch information
redox committed Oct 31, 2014
1 parent 7e6437f commit 4f3c797
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/com/algolia/search/saas/APIClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,11 @@ private JSONObject _request(Method m, String url, String json) throws AlgoliaExc
}
}

RequestConfig config = RequestConfig.custom().setSocketTimeout(HTTP_TIMEOUT_MS).setConnectTimeout(HTTP_TIMEOUT_MS).build();
RequestConfig config = RequestConfig.custom()
.setSocketTimeout(HTTP_TIMEOUT_MS)
.setConnectTimeout(HTTP_TIMEOUT_MS)
.setConnectionRequestTimeout(HTTP_TIMEOUT_MS)
.build();
req.setConfig(config);

HttpResponse response;
Expand Down

0 comments on commit 4f3c797

Please sign in to comment.