Skip to content

Commit

Permalink
修改retrofit超时时间
Browse files Browse the repository at this point in the history
  • Loading branch information
fly803 committed Aug 24, 2018
1 parent d37108f commit cb111f2
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ public static OkHttpClient genericClient() {
请求/响应行 + 头 + 体
*/
final OkHttpClient.Builder builder = new OkHttpClient.Builder();
builder.connectTimeout(15, TimeUnit.SECONDS);
builder.readTimeout(20, TimeUnit.SECONDS);
builder.writeTimeout(20, TimeUnit.SECONDS);
builder.connectTimeout(5, TimeUnit.SECONDS);
builder.readTimeout(10, TimeUnit.SECONDS);
builder.writeTimeout(5, TimeUnit.SECONDS);
//错误重连
builder.retryOnConnectionFailure(true);
//新建log拦截器
Expand Down

0 comments on commit cb111f2

Please sign in to comment.