Commit 46a9520f by huluobin

OkHttpUtil 超时配置

parent ae1a6815
...@@ -20,7 +20,10 @@ public class OkHttpUtil { ...@@ -20,7 +20,10 @@ public class OkHttpUtil {
if (singleton == null) { if (singleton == null) {
singleton = new OkHttpClient.Builder() singleton = new OkHttpClient.Builder()
.retryOnConnectionFailure(true) .retryOnConnectionFailure(true)
.readTimeout(300, TimeUnit.SECONDS) //读取超时 //读取超时
.readTimeout(300, TimeUnit.SECONDS)
.writeTimeout(300, TimeUnit.SECONDS)
.connectTimeout(300, TimeUnit.SECONDS)
.build(); .build();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment