Skip to content

Commit

Permalink
Merge pull request #3 from mosuka/issue_1
Browse files Browse the repository at this point in the history
Supports Ruby or JRuby version 1.9.x syntax.
  • Loading branch information
kmrshntr committed Feb 9, 2016
2 parents 79efa30 + be4c135 commit 43f81a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rsolr/cloud/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ def execute(client, request_context)
path = request_context[:path].to_s
query = request_context[:query]
query = query ? "?#{query}" : ''
url = select_node(collection_name, leader_only: path == 'update')
url = select_node(collection_name, path == 'update')
fail RSolr::Cloud::Error::NotEnoughNodes unless url
request_context[:uri] = RSolr::Uri.create(url).merge(path + query)
super(client, request_context)
end

private

def select_node(collection, leader_only: false)
def select_node(collection, leader_only=false)
if leader_only
synchronize { @leader_urls[collection].to_a.sample }
else
Expand Down

0 comments on commit 43f81a9

Please sign in to comment.