Skip to content

Commit

Permalink
fix: improve end user warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylong committed Nov 24, 2023
1 parent 64a3cde commit 5b7a121
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,21 @@ public NvdApiRetryStrategy(int maxRetries, long delay) {

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

Expand Down

0 comments on commit 5b7a121

Please sign in to comment.