Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RUBY-900 Don't add discovered servers to the cluster with Single topology #609

Merged
merged 3 commits into from
Apr 27, 2015

Conversation

estolfo
Copy link
Contributor

@estolfo estolfo commented Apr 23, 2015

No description provided.

@@ -66,7 +66,7 @@ def ==(other)
# @since 2.0.0
def add(host)
address = Address.new(host)
unless addresses.include?(address)
unless addresses.include?(address) || (@topology.single? && address.seed != @topology.seed)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@durran This line can probably be improved, let me know if you have any other ideas.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably change the logic to to make it a bit less confusing as well as extracting a method on the second part...

if !addresses.include?(address) || direct_connection?(address)
  #...
end

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, thanks

@jeromegn
Copy link
Contributor

I believe that would fix it!

@estolfo
Copy link
Contributor Author

estolfo commented Apr 23, 2015

cool, thanks so much for helping out @jeromegn !

estolfo added a commit that referenced this pull request Apr 27, 2015
RUBY-900 Don't add discovered servers to the cluster with Single topology
@estolfo estolfo merged commit 2f38db3 into mongodb:master Apr 27, 2015
@estolfo estolfo deleted the RUBY-900-single-top branch April 28, 2015 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants