rename onSuccess to onResponse
That makes it a bit clearer that it's about the response and whether we decide if it was a good one or a failure (based on status code)
This commit is contained in:
parent
886cb37efb
commit
f0b6abe439
|
@ -171,7 +171,7 @@ public final class RestClient implements Closeable {
|
|||
int statusCode = response.getStatusLine().getStatusCode();
|
||||
if (statusCode < 300 || (request.getMethod().equals(HttpHead.METHOD_NAME) && statusCode == 404) ) {
|
||||
RequestLogger.logResponse(logger, request, host, httpResponse);
|
||||
onSuccess(host);
|
||||
onResponse(host);
|
||||
return response;
|
||||
}
|
||||
RequestLogger.logResponse(logger, request, host, httpResponse);
|
||||
|
@ -195,7 +195,7 @@ public final class RestClient implements Closeable {
|
|||
break;
|
||||
default:
|
||||
//mark host alive and don't retry, as the error should be a request problem
|
||||
onSuccess(host);
|
||||
onResponse(host);
|
||||
throw lastSeenException;
|
||||
}
|
||||
}
|
||||
|
@ -254,7 +254,7 @@ public final class RestClient implements Closeable {
|
|||
* Called after each successful request call.
|
||||
* Receives as an argument the host that was used for the successful request.
|
||||
*/
|
||||
private void onSuccess(HttpHost host) {
|
||||
private void onResponse(HttpHost host) {
|
||||
DeadHostState removedHost = this.blacklist.remove(host);
|
||||
if (logger.isDebugEnabled() && removedHost != null) {
|
||||
logger.debug("removed host [" + host + "] from blacklist");
|
||||
|
|
Loading…
Reference in New Issue