Skip to content

Commit

Permalink
feature: configurable mysql connection timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
bibendi committed Sep 22, 2015
1 parent 07d726c commit ec3baef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ production:
searchd_file_path: data
binlog_path: binlog
log_level: warn
mysql_connect_timeout: 2
mysql_read_timeout: 5
```
### production with replication
Expand Down Expand Up @@ -113,6 +115,8 @@ production:
agent_connect_timeout: 50
ha_strategy: nodeads
log_level: warn
mysql_connect_timeout: 2
mysql_read_timeout: 5

user: sphinx
remote_path: /home/index/master
Expand Down
4 changes: 2 additions & 2 deletions lib/sphinx/integration/mysql/connection_pool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ def options_for_connection(host, port)
host: host_prepared(host),
port: port_prepared(port),
reconnect: true,
read_timeout: 2,
connect_timeout: 2
read_timeout: ::ThinkingSphinx::Configuration.instance.mysql_read_timeout,
connect_timeout: ::ThinkingSphinx::Configuration.instance.mysql_connect_timeout
}
end

Expand Down

0 comments on commit ec3baef

Please sign in to comment.