Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
saasio
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
reyun
saasio
Commits
6c93818c
Commit
6c93818c
authored
7 years ago
by
carrieyzzhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get time out
parent
19c406e4
master
…
20180326_events4track
30921_bugfix
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
21 deletions
+23
-21
ComplicatedEventsServiceImpl.java
.../com/reyun/service/impl/ComplicatedEventsServiceImpl.java
+22
-20
HttpClientUtil.java
src/main/java/com/reyun/util/HttpClientUtil.java
+1
-1
No files found.
src/main/java/com/reyun/service/impl/ComplicatedEventsServiceImpl.java
View file @
6c93818c
...
...
@@ -1036,27 +1036,29 @@ public class ComplicatedEventsServiceImpl implements ComplicateEventsService{
//group by _cid or group by _campaignid
if
(
groupArray
.
toString
().
contains
(
FIELD_CID
)
||
groupArray
.
toString
().
contains
(
FIELD_CAMPAIGN_ID
))
{
Account
account
=
accountRepository
.
findOne
(
accountId
);
String
url
=
Constant
.
trackingUrl
+
"/api/"
+
app
.
getId
()
+
"/channel/findchannelcamp4io?appkey="
+
app
.
getAppkey
()
+
"&email="
+
account
.
getEmail
();
String
response
=
HttpClientUtil
.
doHttpGetRequest
(
url
,
"io"
);
if
(!
StringUtil
.
isEmpty
(
response
))
{
try
{
JSONObject
ob
=
JSONObject
.
fromObject
(
response
);
JSONObject
content
=
ob
.
getJSONObject
(
"content"
);
if
(
groupArray
.
toString
().
contains
(
FIELD_CID
))
{
JSONObject
channelObject
=
content
.
getJSONObject
(
"channel"
);
ObjectMapper
mapper
=
new
ObjectMapper
();
channelMap
=
mapper
.
readValue
(
channelObject
.
toString
(),
Map
.
class
);
}
if
(
groupArray
.
toString
().
contains
(
FIELD_CAMPAIGN_ID
))
{
JSONObject
campObject
=
content
.
getJSONObject
(
"campaign"
);
ObjectMapper
mapper
=
new
ObjectMapper
();
campaignMap
=
mapper
.
readValue
(
campObject
.
toString
(),
Map
.
class
);
}
}
catch
(
Exception
e
)
{
logger
.
error
(
"fail to get channel or campaign name"
);
}
try
{
String
url
=
Constant
.
trackingUrl
+
"/api/"
+
app
.
getId
()
+
"/channel/findchannelcamp4io?appkey="
+
app
.
getAppkey
()
+
"&email="
+
account
.
getEmail
();
String
response
=
HttpClientUtil
.
doHttpGetRequest
(
url
,
"io"
);
if
(!
StringUtil
.
isEmpty
(
response
))
{
JSONObject
ob
=
JSONObject
.
fromObject
(
response
);
JSONObject
content
=
ob
.
getJSONObject
(
"content"
);
if
(
groupArray
.
toString
().
contains
(
FIELD_CID
))
{
JSONObject
channelObject
=
content
.
getJSONObject
(
"channel"
);
ObjectMapper
mapper
=
new
ObjectMapper
();
channelMap
=
mapper
.
readValue
(
channelObject
.
toString
(),
Map
.
class
);
}
if
(
groupArray
.
toString
().
contains
(
FIELD_CAMPAIGN_ID
))
{
JSONObject
campObject
=
content
.
getJSONObject
(
"campaign"
);
ObjectMapper
mapper
=
new
ObjectMapper
();
campaignMap
=
mapper
.
readValue
(
campObject
.
toString
(),
Map
.
class
);
}
}
}
catch
(
Exception
e
)
{
logger
.
error
(
"fail to get channel or campaign name"
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/com/reyun/util/HttpClientUtil.java
View file @
6c93818c
...
...
@@ -24,7 +24,7 @@ public class HttpClientUtil {
private
static
final
Log
log
=
LogFactory
.
getLog
(
HttpClientUtil
.
class
);
// 读取超时
private
final
static
int
SOCKET_TIMEOUT
=
6
0000
;
private
final
static
int
SOCKET_TIMEOUT
=
1
0000
;
// 连接超时
private
final
static
int
CONNECTION_TIMEOUT
=
60000
;
// 每个HOST的最大连接数量
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment