Skip to content

Commit

Permalink
Reduce output from connection retry
Browse files Browse the repository at this point in the history
  • Loading branch information
bitwiseman committed Jan 30, 2020
1 parent 92a86f4 commit 62590ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/main/java/org/kohsuke/github/Requester.java
Original file line number Diff line number Diff line change
Expand Up @@ -549,9 +549,8 @@ private boolean retryConnectionError(IOException e, int retries) throws IOExcept
|| e instanceof SSLHandshakeException;
if (connectionError && retries > 0) {
LOGGER.log(INFO,
"Error while connecting to " + uc.getURL() + ". Sleeping " + Requester.retryTimeoutMillis
+ " milliseconds before retrying... ; will try " + retries + " more time(s)",
e);
e.getMessage() + " while connecting to " + uc.getURL() + ". Sleeping " + Requester.retryTimeoutMillis
+ " milliseconds before retrying... ; will try " + retries + " more time(s)");
try {
Thread.sleep(Requester.retryTimeoutMillis);
} catch (InterruptedException ie) {
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/kohsuke/github/RequesterRetryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.Map;
import java.util.logging.Handler;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;
import java.util.logging.StreamHandler;

import javax.net.ssl.SSLHandshakeException;
Expand Down Expand Up @@ -55,8 +56,7 @@ private GHRepository getRepository(GitHub gitHub) throws IOException {
@Before
public void attachLogCapturer() {
logCapturingStream = new ByteArrayOutputStream();
Handler[] handlers = log.getParent().getHandlers();
customLogHandler = new StreamHandler(logCapturingStream, handlers[0].getFormatter());
customLogHandler = new StreamHandler(logCapturingStream, new SimpleFormatter());
log.addHandler(customLogHandler);
}

Expand Down

0 comments on commit 62590ab

Please sign in to comment.