refactor: 设置restTemplateWithTimeout 超时时间10s
This commit is contained in:
parent
2860b91508
commit
0edc40b09e
|
@ -27,7 +27,7 @@ public class WebConfig implements WebMvcConfigurer {
|
|||
HttpComponentsClientHttpRequestFactory httpRequestFactory = new HttpComponentsClientHttpRequestFactory();
|
||||
httpRequestFactory.setConnectionRequestTimeout(4000);
|
||||
httpRequestFactory.setConnectTimeout(4000);
|
||||
httpRequestFactory.setReadTimeout(5000);
|
||||
httpRequestFactory.setReadTimeout(10 * 1000);
|
||||
restTemplate.setRequestFactory(httpRequestFactory);
|
||||
return restTemplate;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue