Skip to content

Commit

Permalink
me when i address comments or something
Browse files Browse the repository at this point in the history
Signed-off-by: Maxwell Brown <[email protected]>
  • Loading branch information
Galactus22625 committed Jan 24, 2025
1 parent 813d53e commit 7edf388
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,20 @@ private <T> ResponseEntity<T> invokeRestApi(URI uri, Class<T> responseType) thro
authConfig.renewCredentials();
} else if (statusCode == HttpStatus.TOO_MANY_REQUESTS) {
log.error("Hitting API rate limit. Backing off with sleep timer.");
} else if (statusCode == HttpStatus.SERVICE_UNAVAILABLE) {
log.error("Service unavailable. Will retry after backing off with sleep timer.");
} else if (statusCode == HttpStatus.GATEWAY_TIMEOUT) {
log.error("Gateway timeout. Will retry after backing off with sleep timer.");
} else {
log.error(NOISY, "Exception: ", ex);
log.error(NOISY, "Received an unexpected status code {} response from Jira.", statusCode, ex);
}
try {
Thread.sleep((long) RETRY_ATTEMPT_SLEEP_TIME.get(retryCount) * sleepTimeMultiplier);
} catch (InterruptedException e) {
throw new RuntimeException("Sleep in the retry attempt got interrupted.");
}
} catch (Exception ex) {
log.error(NOISY, "An exception has occurred while getting a response from the Jira search API", ex);
}
retryCount++;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static InetAddress getInetAddress(String url) {
try {
return InetAddress.getByName(new URL(url).getHost());
} catch (UnknownHostException | MalformedURLException e) {
log.error(INVALID_URL + " : {}", url);
log.error("{}: {}", INVALID_URL, url);
throw new BadRequestException(e.getMessage(), e);
}
}
Expand Down

0 comments on commit 7edf388

Please sign in to comment.