Skip to content

Commit

Permalink
fix: correct debug messages (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylong authored Nov 25, 2023
1 parent 71bfc7f commit d8838e3
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,19 @@ public NvdApiRetryStrategy(int maxRetries, long delay) {

@Override
public boolean retryRequest(HttpRequest request, IOException exception, int execCount, HttpContext context) {
if (execCount>=(maxRetries/2)) {
if (execCount >= (maxRetries / 2)) {
LOG.warn("NVD API request failures are occurring; retrying request for the {} time", execCount);
} else {
} else if (execCount > 1) {
LOG.debug("Retrying request {} : {} time", request.getRequestUri(), execCount);
}
return super.retryRequest(request, exception, execCount, context);
}

@Override
public boolean retryRequest(HttpResponse response, int execCount, HttpContext context) {
if (execCount>=(maxRetries/2)) {
if (execCount >= (maxRetries / 2)) {
LOG.warn("NVD API request failures are occurring; retrying request for the {} time", execCount);
} else {
} else if (execCount > 1) {
LOG.debug("Retrying request {} time", execCount);
}
return super.retryRequest(response, execCount, context);
Expand All @@ -88,7 +88,7 @@ public TimeValue getRetryInterval(final HttpResponse response, final int execCou
} else {
value = TimeValue.of(delay * execCount / 2, TimeUnit.MILLISECONDS);
}
//check retry after header
// check retry after header
final Header header = response.getFirstHeader(HttpHeaders.RETRY_AFTER);
if (header != null) {
TimeValue retryAfter = null;
Expand Down

0 comments on commit d8838e3

Please sign in to comment.