Skip to content

Commit bf17ae5

Browse files
Whitespace + adding comment about priority of srv_max_hosts
1 parent fcb4c4b commit bf17ae5

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/mongo/client.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,9 @@ def hash
356356
# that the driver will communicate with for sharded topologies. If this
357357
# option is 0, then there will be no maximum number of mongoses. If the
358358
# given URI resolves to more hosts than ``:srv_max_hosts``, the client
359-
# will ramdomly choose an ``:srv_max_hosts`` sized subset of hosts.
359+
# will randomly choose an ``:srv_max_hosts`` sized subset of hosts. If
360+
# srvMaxHosts is provided in the URI options, it takes precedence over this
361+
# option.
360362
# @option options [ String ] :srv_service_name The service name to use in
361363
# the SRV DNS query.
362364
# @option options [ true, false ] :ssl Whether to use TLS.

lib/mongo/uri/srv_protocol.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ def parse!(remaining)
152152
log_debug "attempting to resolve #{hostname}"
153153

154154
@srv_result = resolver.get_records(
155-
hostname,
156-
uri_options[:srv_service_name] || options[:srv_service_name],
155+
hostname,
156+
uri_options[:srv_service_name] || options[:srv_service_name],
157157
uri_options[:srv_max_hosts] || options[:srv_max_hosts]
158158
)
159159
if srv_result.empty?

0 commit comments

Comments
 (0)