Skip to content

Commit

Permalink
Fix the problem that specifying multiple loadurls does not take effect
Browse files Browse the repository at this point in the history
  • Loading branch information
caoliang-web committed Jan 11, 2024
1 parent ffe215b commit 62f6858
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,10 @@ private HttpEntity getHttpEntity(CloseableHttpResponse resp) {

private String getLoadHost() {
List<String> hostList = options.getLoadUrlList();
long tmp = pos + hostList.size();
for (; pos < tmp; pos++) {
String host = new StringBuilder("http://").append(hostList.get((int) (pos % hostList.size()))).toString();
if (checkConnection(host)) {
return host;
}
Collections.shuffle(hostList);
String host = new StringBuilder("http://").append(hostList.get((0))).toString();
if (checkConnection(host)){
return host;
}
return null;
}
Expand Down

0 comments on commit 62f6858

Please sign in to comment.