Skip to content

Commit 4d7fe4e

Browse files
committed
Convert connect_timeout, read_timeout and write_timeout
Why: * When using a DATABASE_URL env variable with one or more of these params, a type-error is triggered
1 parent 67d1b16 commit 4d7fe4e

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)