Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

Support secondary only connections #62

Merged
merged 1 commit into from
Apr 22, 2013

Conversation

manover
Copy link
Contributor

@manover manover commented Apr 19, 2013

Allow option of connections to secondary only members of replica set

@manover
Copy link
Contributor Author

manover commented Apr 19, 2013

@jehiah Ready for review

# Try primary first
h = self._primary
else:
h = fresh.pop()
h = random.sample(fresh, len(fresh))[0]
Copy link
Member

Choose a reason for hiding this comment

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

is this any different from random.choice(fresh) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually ... you are right, I was thinking about consuming the sequence all the time, but have come to picking a random member, so choice() will be a much cleaner way to do this, thanks!

@jehiah
Copy link
Member

jehiah commented Apr 20, 2013

@manover nice work on this change. aside from some small renames, 👍

jehiah added a commit that referenced this pull request Apr 22, 2013
@jehiah jehiah merged commit 4f92d38 into bitly:master Apr 22, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants