Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Fix in read_preference nearest: Removing nodes with nil latencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunilkumarn committed Apr 27, 2016
1 parent cf817ca commit 9ac3813
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/moped/read_preference/nearest.rb
Expand Up @@ -42,7 +42,7 @@ def name
# @since 2.0.0
def with_node(cluster, &block)
with_retry(cluster) do
nearest = cluster.nodes.sort_by(&:latency).first
nearest = cluster.nodes.select(&:latency).sort_by(&:latency).first
if nearest
block.call(nearest)
else
Expand Down

0 comments on commit 9ac3813

Please sign in to comment.