lib/mongo/cluster.rb in mongo-2.1.2 vs lib/mongo/cluster.rb in mongo-2.2.0.rc0
- old
+ new
@@ -129,14 +129,16 @@
# Get the next primary server we can send an operation to.
#
# @example Get the next primary server.
# cluster.next_primary
#
+ # @param [ true, false ] ping Whether to ping the server before selection.
+ #
# @return [ Mongo::Server ] A primary server.
#
# @since 2.0.0
- def next_primary
- ServerSelector.get(ServerSelector::PRIMARY.merge(options)).select_server(self)
+ def next_primary(ping = true)
+ ServerSelector.get(ServerSelector::PRIMARY.merge(options)).select_server(self, ping)
end
# Elect a primary server from the description that has just changed to a
# primary.
#