Permalink
Browse files

Merge pull request #18 from jcbf/patch-5

Dedup endpoint ips from pool before add.
  • Loading branch information...
2 parents f69597b + 763f15c commit c57944f145607b00fdc4feefcee3cafe8304c2ef @fmgoncalves committed Dec 10, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/Cassandra/Pool.pm
View
@@ -86,7 +86,8 @@ sub add_pool_from_ring {
my $keyspace = shift || $self->{rcp_opts}->{keyspace};
if ($keyspace) {
my @nodes = @{ $self->{pool}->get()->describe_ring($keyspace) };
- my @nodes_ips = map {
+ my %aux;
+ my @nodes_ips = grep { $aux{$_}++ ? undef : $_ } map {
map { split( /\//, $_ ) }
@{ $_->{rpc_endpoints} }
} @nodes;

0 comments on commit c57944f

Please sign in to comment.