Commit 6c93818c by carrieyzzhang

get time out

parent 19c406e4
...@@ -1036,10 +1036,11 @@ public class ComplicatedEventsServiceImpl implements ComplicateEventsService{ ...@@ -1036,10 +1036,11 @@ public class ComplicatedEventsServiceImpl implements ComplicateEventsService{
//group by _cid or group by _campaignid //group by _cid or group by _campaignid
if (groupArray.toString().contains(FIELD_CID) || groupArray.toString().contains(FIELD_CAMPAIGN_ID)) { if (groupArray.toString().contains(FIELD_CID) || groupArray.toString().contains(FIELD_CAMPAIGN_ID)) {
Account account = accountRepository.findOne(accountId); Account account = accountRepository.findOne(accountId);
try {
String url = Constant.trackingUrl + "/api/"+ app.getId() +"/channel/findchannelcamp4io?appkey=" + app.getAppkey() + "&email=" + account.getEmail(); String url = Constant.trackingUrl + "/api/"+ app.getId() +"/channel/findchannelcamp4io?appkey=" + app.getAppkey() + "&email=" + account.getEmail();
String response = HttpClientUtil.doHttpGetRequest(url, "io"); String response = HttpClientUtil.doHttpGetRequest(url, "io");
if (!StringUtil.isEmpty(response)) { if (!StringUtil.isEmpty(response)) {
try {
JSONObject ob = JSONObject.fromObject(response); JSONObject ob = JSONObject.fromObject(response);
JSONObject content = ob.getJSONObject("content"); JSONObject content = ob.getJSONObject("content");
if (groupArray.toString().contains(FIELD_CID)) { if (groupArray.toString().contains(FIELD_CID)) {
...@@ -1053,14 +1054,15 @@ public class ComplicatedEventsServiceImpl implements ComplicateEventsService{ ...@@ -1053,14 +1054,15 @@ public class ComplicatedEventsServiceImpl implements ComplicateEventsService{
campaignMap = mapper.readValue(campObject.toString(), Map.class); campaignMap = mapper.readValue(campObject.toString(), Map.class);
} }
}
} catch (Exception e) { } catch (Exception e) {
logger.error("fail to get channel or campaign name"); logger.error("fail to get channel or campaign name");
} }
} }
}
//1,处理日期合并(给每个日期的第一行加标注,firstDateRow标示第一行,rowNum标示相同日期行数) //1,处理日期合并(给每个日期的第一行加标注,firstDateRow标示第一行,rowNum标示相同日期行数)
String firstValueDate = ""; String firstValueDate = "";
......
...@@ -24,7 +24,7 @@ public class HttpClientUtil { ...@@ -24,7 +24,7 @@ public class HttpClientUtil {
private static final Log log = LogFactory.getLog(HttpClientUtil.class); private static final Log log = LogFactory.getLog(HttpClientUtil.class);
// 读取超时 // 读取超时
private final static int SOCKET_TIMEOUT = 60000; private final static int SOCKET_TIMEOUT = 10000;
// 连接超时 // 连接超时
private final static int CONNECTION_TIMEOUT = 60000; private final static int CONNECTION_TIMEOUT = 60000;
// 每个HOST的最大连接数量 // 每个HOST的最大连接数量
......
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