make sure we always set wait_timeout even if a bad value was given
This commit is contained in:
parent
e7dcf37bd4
commit
7e75f5ed4c
|
@ -622,8 +622,9 @@ module ActiveRecord
|
||||||
variable_assignments << "NAMES '#{encoding}'" if encoding
|
variable_assignments << "NAMES '#{encoding}'" if encoding
|
||||||
|
|
||||||
# increase timeout so mysql server doesn't disconnect us
|
# increase timeout so mysql server doesn't disconnect us
|
||||||
wait_timeout = @config[:wait_timeout] || 2592000
|
wait_timeout = @config[:wait_timeout]
|
||||||
variable_assignments << "@@wait_timeout = #{wait_timeout}" if wait_timeout.is_a?(Fixnum)
|
wait_timeout = 2592000 unless wait_timeout.is_a?(Fixnum)
|
||||||
|
variable_assignments << "@@wait_timeout = #{wait_timeout}"
|
||||||
|
|
||||||
execute("SET #{variable_assignments.join(', ')}", :skip_logging)
|
execute("SET #{variable_assignments.join(', ')}", :skip_logging)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue