Skip to content

Commit

Permalink
add options for setting mysql connection timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Conway committed Apr 22, 2009
1 parent 617d7eb commit d269724
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -71,6 +71,9 @@ def self.mysql_connection(config) # :nodoc:
MysqlCompat.define_all_hashes_method!

mysql = Mysql.init
mysql.options(Mysql::OPT_CONNECT_TIMEOUT, config[:connect_timeout]) if config[:connect_timeout]
mysql.options(Mysql::OPT_READ_TIMEOUT, config[:read_timeout]) if config[:read_timeout]
mysql.options(Mysql::OPT_WRITE_TIMEOUT, config[:write_timeout]) if config[:write_timeout]
mysql.ssl_set(config[:sslkey], config[:sslcert], config[:sslca], config[:sslcapath], config[:sslcipher]) if config[:sslca] || config[:sslkey]

ConnectionAdapters::MysqlAdapter.new(mysql, logger, [host, username, password, database, port, socket], config)
Expand Down

0 comments on commit d269724

Please sign in to comment.