提交 d2df4db2 编写于 作者: wu-sheng's avatar wu-sheng

Adjust the find server codes.

上级 8658ca77
......@@ -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;
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册