Skip to content

Commit

Permalink
chore: restore build by fixing spotless errors
Browse files Browse the repository at this point in the history
  • Loading branch information
chadlwilson committed Jun 29, 2024
1 parent 47333c9 commit dd7f0f4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public NvdApiRetryStrategy(int maxRetries, long delay) {
}

@Override
public boolean retryRequest(@Nonnull HttpRequest request, @Nonnull IOException exception, int execCount, HttpContext context) {
public boolean retryRequest(@Nonnull HttpRequest request, @Nonnull IOException exception, int execCount,
HttpContext context) {
logRetryState(request, exception, execCount);
return super.retryRequest(request, exception, execCount, context);
}
Expand All @@ -83,12 +84,14 @@ private void logRetryState(@Nonnull HttpRequest request, @Nonnull IOException ex
if (execCount >= (maxRetries / 2)) {
LOG.warn(RETRY_MESSAGE_TEMPLATE, execCount);
if (LOG.isDebugEnabled()) {
LOG.debug("NVD API request failures with exception : {}. Message: {}", exception.getClass().getName(), exception.getMessage());
LOG.debug("NVD API request failures with exception : {}. Message: {}", exception.getClass().getName(),
exception.getMessage());
}
} else if (execCount > 1) {
LOG.warn("Retrying request {} : {} time", request.getRequestUri(), execCount);
if (LOG.isDebugEnabled()) {
LOG.debug("Retrying request with exception {}. Message: {}", exception.getClass().getName(), exception.getMessage());
LOG.debug("Retrying request with exception {}. Message: {}", exception.getClass().getName(),
exception.getMessage());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ class RateLimitedClient implements AutoCloseable {
* configure 5 requests are allowed over a 30-second rolling window and we will delay at least 4 seconds between
* calls to help more evenly distribute the calls across the request window.
*
* @param minimumDelay the number of milliseconds to wait between API calls
* @param requestsCount the number of requests allowed during the rolling request window timespan
* @param minimumDelay the number of milliseconds to wait between API calls
* @param requestsCount the number of requests allowed during the rolling request window timespan
* @param requestWindowMilliseconds the rolling request window size in milliseconds
*/
RateLimitedClient(long minimumDelay, int requestsCount, long requestWindowMilliseconds) {
Expand All @@ -105,7 +105,7 @@ class RateLimitedClient implements AutoCloseable {
* calls to help more evenly distribute the calls across the request window.
*
* @param minimumDelay the number of milliseconds to wait between API calls
* @param meter the rate meter to limit the request rate
* @param meter the rate meter to limit the request rate
*/
RateLimitedClient(long minimumDelay, RateMeter meter) {
this(10, minimumDelay, meter, null);
Expand All @@ -116,9 +116,9 @@ class RateLimitedClient implements AutoCloseable {
* configure 5 requests are allowed over a 30-second rolling window and we will delay at least 4 seconds between
* calls to help more evenly distribute the calls across the request window.
*
* @param maxRetries the maximum number of retry attemps
* @param minimumDelay the number of milliseconds to wait between API calls
* @param meter the rate meter to limit the request rate
* @param maxRetries the maximum number of retry attemps
* @param minimumDelay the number of milliseconds to wait between API calls
* @param meter the rate meter to limit the request rate
* @param httpClientSupplier supplier for custom HTTP clients; if {@code null} a default client will be used
*/
RateLimitedClient(int maxRetries, long minimumDelay, RateMeter meter, HttpAsyncClientSupplier httpClientSupplier) {
Expand Down Expand Up @@ -178,7 +178,7 @@ Future<RateLimitedCall> execute(SimpleHttpRequest request, int clientIndex, int
*
* @param request the request
* @return the future response
* @throws ExecutionException thrown if there is an exception
* @throws ExecutionException thrown if there is an exception
* @throws InterruptedException thrown if interrupted
*/
private RateLimitedCall delayedExecute(SimpleHttpRequest request, int clientIndex, int startIndex)
Expand Down

0 comments on commit dd7f0f4

Please sign in to comment.