Commit 844f8eeb7f25a44ebcf47bcfa7c24ab925753723
1 parent
bff5bbe9
update...
Showing
1 changed file
with
4 additions
and
4 deletions
src/main/java/com/bsth/data/utils/HttpClientUtils.java
| @@ -31,8 +31,8 @@ public class HttpClientUtils { | @@ -31,8 +31,8 @@ public class HttpClientUtils { | ||
| 31 | HttpGet get = new HttpGet(url); | 31 | HttpGet get = new HttpGet(url); |
| 32 | //超时时间 | 32 | //超时时间 |
| 33 | RequestConfig requestConfig = RequestConfig.custom() | 33 | RequestConfig requestConfig = RequestConfig.custom() |
| 34 | - .setConnectTimeout(4500).setConnectionRequestTimeout(4000) | ||
| 35 | - .setSocketTimeout(4500).build(); | 34 | + .setConnectTimeout(12500).setConnectionRequestTimeout(12000) |
| 35 | + .setSocketTimeout(12500).build(); | ||
| 36 | get.setConfig(requestConfig); | 36 | get.setConfig(requestConfig); |
| 37 | get.addHeader("Content-Encoding", "gzip"); | 37 | get.addHeader("Content-Encoding", "gzip"); |
| 38 | 38 | ||
| @@ -67,8 +67,8 @@ public class HttpClientUtils { | @@ -67,8 +67,8 @@ public class HttpClientUtils { | ||
| 67 | post.setHeader("Content-Type", "application/json"); | 67 | post.setHeader("Content-Type", "application/json"); |
| 68 | //超时时间 | 68 | //超时时间 |
| 69 | RequestConfig requestConfig = RequestConfig.custom() | 69 | RequestConfig requestConfig = RequestConfig.custom() |
| 70 | - .setConnectTimeout(2500).setConnectionRequestTimeout(2000) | ||
| 71 | - .setSocketTimeout(3500).build(); | 70 | + .setConnectTimeout(7500).setConnectionRequestTimeout(7000) |
| 71 | + .setSocketTimeout(8500).build(); | ||
| 72 | post.setConfig(requestConfig); | 72 | post.setConfig(requestConfig); |
| 73 | post.setEntity((new StringEntity(data, "UTF-8"))); | 73 | post.setEntity((new StringEntity(data, "UTF-8"))); |
| 74 | 74 |