while (it.hasNext()) { FailedHostInfo fHost = (FailedHostInfo) it.next(); if (attemptsLimit == fHost.getAttempts()) { it.remove(); log.info("Host " + fHost.getServerUrl() + " has reached reconnect attempts limit " + attemptsLimit + " quiting"); continue; HttpUtils.getHttpCall(fHost.getServerUrl()); log.info("Server at " + fHost.getServerUrl() + " is back online"); failedHostsReconnects.cancel(false); for (String containerId : fHost.getContainers()) { configuration.addContainerHost(containerId, fHost.getServerUrl()); configuration.addServerHost(fHost.getServerId(), fHost.getServerUrl()); log.debug("Host " + fHost.getServerUrl() + " is still not available, attempting to reconnect in " + interval + " seconds, error " + e.getMessage()); } finally { fHost.attempted();
); FailedHostInfo failedHost = new FailedHostInfo(serverId, serverUrl, containers); return failedHost;
); FailedHostInfo failedHost = new FailedHostInfo(serverId, serverUrl, containers); return failedHost;
while (it.hasNext()) { FailedHostInfo fHost = (FailedHostInfo) it.next(); if (attemptsLimit == fHost.getAttempts()) { it.remove(); log.info("Host " + fHost.getServerUrl() + " has reached reconnect attempts limit " + attemptsLimit + " quiting"); continue; HttpUtils.getHttpCall(fHost.getServerUrl()); log.info("Server at " + fHost.getServerUrl() + " is back online"); failedHostsReconnects.cancel(false); for (String containerId : fHost.getContainers()) { configuration.addContainerHost(containerId, fHost.getServerUrl()); configuration.addServerHost(fHost.getServerId(), fHost.getServerUrl()); log.debug("Host " + fHost.getServerUrl() + " is still not available, attempting to reconnect in " + interval + " seconds, error " + e.getMessage()); } finally { fHost.attempted();