Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
熊鹏飞
/
xxljob220
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
667d4868
authored
Aug 26, 2017
by
xuxueli
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
httpclient防止重复提交
parent
837ab404
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
xxl-job-core/src/main/java/com/xxl/job/core/util/HttpClientUtil.java
xxl-job-core/src/main/java/com/xxl/job/core/util/HttpClientUtil.java
View file @
667d4868
...
@@ -30,7 +30,9 @@ public class HttpClientUtil {
...
@@ -30,7 +30,9 @@ public class HttpClientUtil {
byte
[]
responseBytes
=
null
;
byte
[]
responseBytes
=
null
;
HttpPost
httpPost
=
new
HttpPost
(
reqURL
);
HttpPost
httpPost
=
new
HttpPost
(
reqURL
);
CloseableHttpClient
httpClient
=
HttpClients
.
createDefault
();
//CloseableHttpClient httpClient = HttpClients.createDefault();
CloseableHttpClient
httpClient
=
HttpClients
.
custom
().
disableAutomaticRetries
().
build
();
// disable retry
try
{
try
{
// init post
// init post
/*if (params != null && !params.isEmpty()) {
/*if (params != null && !params.isEmpty()) {
...
@@ -62,7 +64,7 @@ public class HttpClientUtil {
...
@@ -62,7 +64,7 @@ public class HttpClientUtil {
EntityUtils
.
consume
(
entity
);
EntityUtils
.
consume
(
entity
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
()
,
e
);
logger
.
error
(
""
,
e
);
throw
e
;
throw
e
;
}
finally
{
}
finally
{
httpPost
.
releaseConnection
();
httpPost
.
releaseConnection
();
...
...
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