Skip to content

Commit

Permalink
Merge pull request #65 from bibendi/master
Browse files Browse the repository at this point in the history
fix: misstypes in connection pool
  • Loading branch information
bibendi committed Sep 20, 2015
2 parents 277295b + 22b34c3 commit 2cf1c9b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/sphinx/integration/mysql/connection_pool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def take_slaves(&block)
@agents ||= ThinkingSphinx::Configuration.instance.agents
errors = []

agents.each do |agent_name, _|
@agents.each do |agent_name, _|
begin
take(slaves_pool(agent_name), &block)
rescue ::Innertube::Pool::BadResource,
Expand All @@ -64,7 +64,7 @@ def take_slaves(&block)
end

# Райзим ошибку, только если она получаена от обоих реплик
return if errors.size < agents.size
return if errors.size < @agents.size
raise errors[0]
end

Expand Down Expand Up @@ -115,7 +115,7 @@ def master_pool
end

def slaves_pool(agent_name)
@slavess_lock.synchronize do
@slaves_lock.synchronize do
@slaves_pool[agent_name] ||= Innertube::Pool.new(
proc { ::Sphinx::Integration::Mysql::ConnectionPool.slave_connection(agent_name) },
proc { |connection| connection.close }
Expand Down

0 comments on commit 2cf1c9b

Please sign in to comment.