Skip to content

Commit 6d0daaf

Browse files
authored
Merge pull request brianmario#791 from helgeblod/master
Avoid type error when using connect_timeout, read_timeout and write_timeout in a DATABASE_URL env variable
2 parents 67d1b16 + 4d7fe4e commit 6d0daaf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/mysql2/client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def initialize(opts = {})
3636
when :reconnect, :local_infile, :secure_auth, :automatic_close
3737
send(:"#{key}=", !!opts[key]) # rubocop:disable Style/DoubleNegation
3838
when :connect_timeout, :read_timeout, :write_timeout
39-
send(:"#{key}=", opts[key]) unless opts[key].nil?
39+
send(:"#{key}=", opts[key].to_i) unless opts[key].nil?
4040
else
4141
send(:"#{key}=", opts[key])
4242
end

0 commit comments

Comments
 (0)