if (current + time > startTime + timeout) {
time = startTime + timeout - current;
}
}
if (current > startTime + timeout || time <= 0) {
throw new TimeoutExpiredException("Could not connect to any of the URIs: " + list);
}
}
log.info("Could not connect; sleeping for: " + time + " millis and trying again");
try {
Thread.sleep(time);