Skip to content

Commit

Permalink
Redis Hostname provider - do not call getHosts() twice
Browse files Browse the repository at this point in the history
  • Loading branch information
cescoffier committed Jun 4, 2023
1 parent 947d3a9 commit 06b69ea
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import io.quarkus.arc.Arc;
import io.quarkus.arc.ArcContainer;
Expand Down Expand Up @@ -51,8 +52,9 @@ public static Redis create(String name, Vertx vertx, RedisClientConfig config) {
}
} else if (config.hostsProviderName.isPresent()) {
RedisHostsProvider hostsProvider = findProvider(config.hostsProviderName.get());
hosts.addAll(hostsProvider.getHosts());
for (URI uri : hostsProvider.getHosts()) {
Set<URI> computedHosts = hostsProvider.getHosts();
hosts.addAll(computedHosts);
for (URI uri : computedHosts) {
options.addConnectionString(uri.toString());
}
} else {
Expand Down

0 comments on commit 06b69ea

Please sign in to comment.