diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2016-09-20 23:41:30 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-02-24 05:54:13 +0900 |
commit | 8aa43f9590ad7f2e47c09d82c266447b39078cb4 (patch) | |
tree | 7fec1993b39703b425097106c96efc6a92220158 /activerecord/lib/active_record/connection_adapters | |
parent | 71df60e921a784fb01729e98fa9636a4b6862d72 (diff) | |
download | rails-8aa43f9590ad7f2e47c09d82c266447b39078cb4.tar.gz rails-8aa43f9590ad7f2e47c09d82c266447b39078cb4.tar.bz2 rails-8aa43f9590ad7f2e47c09d82c266447b39078cb4.zip |
Fix `wait_timeout` to configurable for mysql2 adapter
Fixes #26556.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb index 12dce89306..5f86a11c2d 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -870,9 +870,9 @@ module ActiveRecord variables["sql_auto_is_null"] = 0 # Increase timeout so the server doesn't disconnect us. - wait_timeout = @config[:wait_timeout] + wait_timeout = self.class.type_cast_config_to_integer(@config[:wait_timeout]) wait_timeout = 2147483 unless wait_timeout.is_a?(Integer) - variables["wait_timeout"] = self.class.type_cast_config_to_integer(wait_timeout) + variables["wait_timeout"] = wait_timeout defaults = [":default", :default].to_set |