Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
duniter4j
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
clients
java
duniter4j
Commits
ea40fcfb
Commit
ea40fcfb
authored
Jan 08, 2019
by
Benoit Lavenier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimize debug log
parent
51db3502
Pipeline
#4331
passed with stage
in 27 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
duniter4j-core-client/src/main/java/org/duniter/core/client/service/HttpServiceImpl.java
...java/org/duniter/core/client/service/HttpServiceImpl.java
+5
-5
No files found.
duniter4j-core-client/src/main/java/org/duniter/core/client/service/HttpServiceImpl.java
View file @
ea40fcfb
...
...
@@ -309,14 +309,14 @@ public class HttpServiceImpl implements HttpService, Closeable, InitializingBean
HttpClientContext
clientContext
=
HttpClientContext
.
adapt
(
context
);
HttpRequest
request
=
clientContext
.
getRequest
();
if
(!
retrying
)
{
log
.
debug
(
"Failed request to "
+
request
.
getRequestLine
()
+
": "
+
exception
.
getMessage
());
if
(
debug
)
log
.
debug
(
"Failed request to "
+
request
.
getRequestLine
()
+
": "
+
exception
.
getMessage
());
return
false
;
}
boolean
idempotent
=
!(
request
instanceof
HttpEntityEnclosingRequest
);
if
(
idempotent
)
{
// Retry if the request is considered idempotent
log
.
debug
(
"Failed (but will retry) request to "
+
request
.
getRequestLine
()
+
": "
+
exception
.
getMessage
());
if
(
debug
)
log
.
debug
(
"Failed (but will retry) request to "
+
request
.
getRequestLine
()
+
": "
+
exception
.
getMessage
());
return
true
;
}
return
false
;
...
...
@@ -429,7 +429,7 @@ public class HttpServiceImpl implements HttpService, Closeable, InitializingBean
// HTTP requests limit exceed, retry when possible
if
(
retry
)
{
if
(
retryCount
>
0
)
{
log
.
debug
(
String
.
format
(
"Service unavailable: waiting [%s ms] before retrying..."
,
Constants
.
Config
.
TOO_MANY_REQUEST_RETRY_TIME
));
if
(
debug
)
log
.
debug
(
String
.
format
(
"Service unavailable: waiting [%s ms] before retrying..."
,
Constants
.
Config
.
TOO_MANY_REQUEST_RETRY_TIME
));
try
{
Thread
.
sleep
(
Constants
.
Config
.
TOO_MANY_REQUEST_RETRY_TIME
);
}
catch
(
InterruptedException
e
)
{
...
...
@@ -464,7 +464,7 @@ public class HttpServiceImpl implements HttpService, Closeable, InitializingBean
try
{
String
stringContent
=
getContentAsString
(
content
);
// Add a debug before returning the result
if
(
log
.
isDebugEnabled
()
)
{
if
(
debug
)
{
log
.
debug
(
"Parsing response:\n"
+
stringContent
);
}
return
stringContent
;
...
...
@@ -529,7 +529,7 @@ public class HttpServiceImpl implements HttpService, Closeable, InitializingBean
protected
boolean
executeRequest
(
HttpClient
httpClient
,
HttpUriRequest
request
)
{
if
(
log
.
isDebugEnabled
()
)
{
if
(
debug
)
{
log
.
debug
(
"Executing request : "
+
request
.
getRequestLine
());
}
...
...
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