diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/pushData/PushU8CByApiCode.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/pushData/PushU8CByApiCode.java index dd869fc8..37082550 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/pushData/PushU8CByApiCode.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/pushData/PushU8CByApiCode.java @@ -56,6 +56,13 @@ public class PushU8CByApiCode { httpPost.setHeader("apicode", apicode); //data httpPost.setEntity(new StringEntity(data, "UTF-8")); + // 配置请求的超时设置 + RequestConfig requestConfig = RequestConfig.custom() + .setConnectTimeout(600000) // 连接超时时间: 600秒 + .setConnectionRequestTimeout(600000) // 请求超时时间: 600秒 + .setSocketTimeout(600000) // 数据读取超时时间: 600秒 + .build(); + httpPost.setConfig(requestConfig); CloseableHttpResponse response = httpclient.execute(httpPost); HttpEntity entity = response.getEntity(); @@ -96,6 +103,14 @@ public class PushU8CByApiCode { httpPost.setHeader("apicode", apicode); //data httpPost.setEntity(new StringEntity(data, "UTF-8")); + + // 配置请求的超时设置 + RequestConfig requestConfig = RequestConfig.custom() + .setConnectTimeout(600000) // 连接超时时间: 600秒 + .setConnectionRequestTimeout(600000) // 请求超时时间: 600秒 + .setSocketTimeout(600000) // 数据读取超时时间: 600秒 + .build(); + httpPost.setConfig(requestConfig); CloseableHttpResponse response = httpclient.execute(httpPost); HttpEntity entity = response.getEntity(); String result = EntityUtils.toString(entity);