From fdab92700dac8e2e8cef888905479245d7ecea4b Mon Sep 17 00:00:00 2001 From: LuoYe_MyWork Date: Mon, 21 Sep 2020 16:13:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9http=E8=B6=85=E6=97=B6?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/qyi/e5/util/netRequest/OkHttpClientUtil.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/io/qyi/e5/util/netRequest/OkHttpClientUtil.java b/src/main/java/io/qyi/e5/util/netRequest/OkHttpClientUtil.java index 939c174..e7434d6 100644 --- a/src/main/java/io/qyi/e5/util/netRequest/OkHttpClientUtil.java +++ b/src/main/java/io/qyi/e5/util/netRequest/OkHttpClientUtil.java @@ -18,16 +18,16 @@ import okhttp3.RequestBody; import okhttp3.Response; public class OkHttpClientUtil { - private static int connTimeOut = 5; - private static int readTimeOut = 20; - private static int writeTimeOut = 10; + private static int connTimeOut = 5 * 1000; + private static int readTimeOut = 20 * 1000; + private static int writeTimeOut = 10 * 1000; public static OkHttpClient client = null; static { client = new OkHttpClient.Builder() - .connectTimeout(5L, TimeUnit.SECONDS) - .readTimeout(20L, TimeUnit.SECONDS) - .writeTimeout(10L, TimeUnit.SECONDS) + .connectTimeout(connTimeOut, TimeUnit.SECONDS) + .readTimeout(readTimeOut, TimeUnit.SECONDS) + .writeTimeout(writeTimeOut, TimeUnit.SECONDS) .retryOnConnectionFailure(true) .build(); }