Merge branch 'master' into fix/spring-aop-issue

This commit is contained in:
吴晟 Wu Sheng 2017-11-19 01:08:12 -06:00 committed by GitHub
commit 1c762f1c21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 12 deletions

View File

@ -141,21 +141,12 @@ public class DiscoveryRestServiceClient implements Runnable {
*/
private void findBackupServer() {
selectedServer++;
if (selectedServer == serverList.length) {
if (selectedServer >= serverList.length) {
selectedServer = 0;
}
}
/**
* Try to sleep, and ignore the {@link InterruptedException}
*
* @param millis the length of time to sleep in milliseconds
*/
private void try2Sleep(long millis) {
try {
Thread.sleep(millis);
} catch (InterruptedException e) {
if (serverList.length == 0) {
selectedServer = -1;
}
}
}