diff --git a/lib/google/apis/core/base_service.rb b/lib/google/apis/core/base_service.rb index 98bf7a64d..c3431f31d 100644 --- a/lib/google/apis/core/base_service.rb +++ b/lib/google/apis/core/base_service.rb @@ -292,6 +292,7 @@ module Google def new_client client = Hurley::Client.new client.request_options.timeout = request_options.timeout_sec + client.request_options.open_timeout = request_options.open_timeout_sec client.request_options.proxy = client_options.proxy_url client.request_options.query_class = Hurley::Query::Flat client.ssl_options.ca_file = File.join(Google::Apis::ROOT, 'lib', 'cacerts.pem') diff --git a/lib/google/apis/options.rb b/lib/google/apis/options.rb index 3cf5c4df1..593cb58ca 100644 --- a/lib/google/apis/options.rb +++ b/lib/google/apis/options.rb @@ -24,7 +24,8 @@ module Google :authorization, :retries, :header, - :timeout_sec) + :timeout_sec, + :open_timeout_sec) # General client options class ClientOptions @@ -50,6 +51,8 @@ module Google # @return [Fixnum] Number of times to retry requests on server error # @!attribute [rw] timeout_sec # @return [Fixnum] How long, in seconds, before requests time out + # @!attribute [rw] open_timeout_sec + # @return [Fixnum] How long, in seconds, before failed connections time out # @!attribute [rw] header # @return [Hash