We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d3fa75d commit 295de5bCopy full SHA for 295de5b
polaris-sync-commons/src/main/java/cn/polarismesh/polaris/sync/common/rest/RestOperator.java
@@ -47,8 +47,11 @@ public static String pickAddress(List<String> addresses) {
47
return addresses.get(0);
48
}
49
Random random = new Random();
50
- int i = random.nextInt();
51
- return addresses.get(i % addresses.size());
+ int i = random.nextInt(addresses.size());
+ if (i >= addresses.size()) {
52
+ i = 0;
53
+ }
54
+ return addresses.get(i);
55
56
57
public <T> RestResponse<T> curlRemoteEndpoint(String url, HttpMethod method,
0 commit comments