add option for setting the wait_timeout in the AR adapter (this can be done in database.yml)
This commit is contained in:
parent
c394122fd9
commit
832eb2d247
@ -617,8 +617,13 @@ module ActiveRecord
|
|||||||
# Turn this off. http://dev.rubyonrails.org/ticket/6778
|
# Turn this off. http://dev.rubyonrails.org/ticket/6778
|
||||||
variable_assignments = ['SQL_AUTO_IS_NULL=0']
|
variable_assignments = ['SQL_AUTO_IS_NULL=0']
|
||||||
encoding = @config[:encoding]
|
encoding = @config[:encoding]
|
||||||
|
|
||||||
|
# make sure we set the encoding
|
||||||
variable_assignments << "NAMES '#{encoding}'" if encoding
|
variable_assignments << "NAMES '#{encoding}'" if encoding
|
||||||
|
|
||||||
|
# increase timeout so mysql server doesn't disconnect us
|
||||||
|
variable_assignments << "@@wait_timeout = #{@config[:wait_timeout] || 2592000}"
|
||||||
|
|
||||||
execute("SET #{variable_assignments.join(', ')}", :skip_logging)
|
execute("SET #{variable_assignments.join(', ')}", :skip_logging)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user