Skip to content

Commit

Permalink
fix(mysql): обрежем время ответа для слейвов для отказоустойчивости
Browse files Browse the repository at this point in the history
  • Loading branch information
bibendi committed Oct 24, 2013
1 parent ff9a0f9 commit 2243da5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/sphinx/integration/mysql/connection_pool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ def self.slave_connection(agent_name)
options = {
:host => address_prepared(agent[:address]),
:port => port_prepared(agent[:mysql41]),
:reconnect => true
:reconnect => true,
:read_timeout => 1, # очень хочется 300мс, но к сожалению можно только в секундах :(
:connect_timeout => 1
}

Sphinx::Integration::Mysql::Connection.new options[:host], options[:port], options
Expand Down

0 comments on commit 2243da5

Please sign in to comment.