google-gax 1.7.0 → 1.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7271bd48161698b84de9f66e337c3742e44b765f75fa1344c2e59b3608359e65
4
- data.tar.gz: d2483f6d0f41e82f6655a1d5893712785721b73b7c675772752f457c9de0986e
3
+ metadata.gz: a7f8010fa4f0d2dfc3ace5ee432ffa2f583e929d7eda782683f610405e92b74a
4
+ data.tar.gz: a37e9831369c63beb27229466d88977b08641bdc1d3fcafece667c30f852bfdb
5
5
  SHA512:
6
- metadata.gz: 8b92de0ba1398fd9d71a7cdd66aa000975677996fefcfdcf4828d12c6fff7194c0b93da9178eaf26d51d924f77dc3b493ad3bffba5011d1e8ea7bfb670d92311
7
- data.tar.gz: cf0103edeab0f7e8244b2e008d72974bb7562236281d6eed0ce2466740f48a56a433d934286d9205d89d84382003ace8f55527250cba09b4868b6b57b80b74e1
6
+ metadata.gz: f9592566de488a67eabb12c5c7d9552313708342fc458ddf153d342ff271166906e05c592038525ccb6df4ca5a7aec86d51c653908d2733834588bafe7f50390
7
+ data.tar.gz: 44cbb8ffbfb3ef7b47b1d1eee2cefddee2f4fa20d03fc4b4cb0d19d127a1156dfa379250aab52bb546c327c657d1d3c5fc625eb8cd5118cba819bf9350cf51d4
@@ -511,7 +511,9 @@ module Google
511
511
  bundle_descriptor = bundle_descriptors[snake_name]
512
512
 
513
513
  defaults[snake_name] = CallSettings.new(
514
- timeout: timeout,
514
+ timeout: calc_method_timeout(
515
+ timeout, method_config, overriding_method
516
+ ),
515
517
  retry_options: merge_retry_options(
516
518
  construct_retry(method_config,
517
519
  service_config['retry_codes'],
@@ -533,11 +535,20 @@ module Google
533
535
  defaults
534
536
  end
535
537
 
538
+ # @private Determine timeout in seconds for the current method.
539
+ def calc_method_timeout(timeout, method_config, overriding_method)
540
+ timeout_override = method_config['timeout_millis']
541
+ if overriding_method && overriding_method.key?('timeout_millis')
542
+ timeout_override = overriding_method['timeout_millis']
543
+ end
544
+ timeout_override ? timeout_override / 1000 : timeout
545
+ end
546
+
536
547
  module_function :construct_settings, :construct_bundling,
537
548
  :construct_retry, :upper_camel_to_lower_underscore,
538
- :merge_retry_options
549
+ :merge_retry_options, :calc_method_timeout
539
550
  private_class_method :construct_bundling, :construct_retry,
540
551
  :upper_camel_to_lower_underscore,
541
- :merge_retry_options
552
+ :merge_retry_options, :calc_method_timeout
542
553
  end
543
554
  end
@@ -29,6 +29,6 @@
29
29
 
30
30
  module Google
31
31
  module Gax
32
- VERSION = '1.7.0'.freeze
32
+ VERSION = '1.7.1'.freeze
33
33
  end
34
34
  end
@@ -63,6 +63,9 @@ A_CONFIG = {
63
63
  'SomeHTTPSPageStreamingMethod' => {
64
64
  'retry_codes_name' => 'bar_retry',
65
65
  'retry_params_name' => 'default'
66
+ },
67
+ 'TimeoutMethod' => {
68
+ 'timeout_millis' => 10_000
66
69
  }
67
70
  }
68
71
  }
@@ -119,6 +122,9 @@ describe Google::Gax do
119
122
  )
120
123
  expect(settings.metadata).to match('key' => 'value')
121
124
  expect(settings.errors).to match_array([StandardError])
125
+
126
+ settings = defaults['timeout_method']
127
+ expect(settings.timeout).to be(10)
122
128
  end
123
129
 
124
130
  it 'overrides settings' do
@@ -129,6 +135,9 @@ describe Google::Gax do
129
135
  'SomeHTTPSPageStreamingMethod' => nil,
130
136
  'BundlingMethod' => {
131
137
  'bundling' => nil
138
+ },
139
+ 'TimeoutMethod' => {
140
+ 'timeout_millis' => nil
132
141
  }
133
142
  }
134
143
  }
@@ -149,6 +158,9 @@ describe Google::Gax do
149
158
  expect(settings.timeout).to be(30)
150
159
  expect(settings.page_descriptor).to be_a(Google::Gax::PageDescriptor)
151
160
  expect(settings.retry_options).to be_nil
161
+
162
+ settings = defaults['timeout_method']
163
+ expect(settings.timeout).to be(30)
152
164
  end
153
165
 
154
166
  it 'overrides settings more precisely' do
@@ -174,6 +186,9 @@ describe Google::Gax do
174
186
  'BundlingMethod' => {
175
187
  'retry_params_name' => 'default',
176
188
  'retry_codes_name' => 'baz_retry'
189
+ },
190
+ 'TimeoutMethod' => {
191
+ 'timeout_millis' => 20_000
177
192
  }
178
193
  }
179
194
  }
@@ -205,5 +220,8 @@ describe Google::Gax do
205
220
  expect(settings.retry_options.retry_codes).to match_array(
206
221
  [RETRY_DICT['code_c']]
207
222
  )
223
+
224
+ settings = defaults['timeout_method']
225
+ expect(settings.timeout).to be(20)
208
226
  end
209
227
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-gax
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google API Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-27 00:00:00.000000000 Z
11
+ date: 2019-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: googleauth
@@ -222,7 +222,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
222
222
  - !ruby/object:Gem::Version
223
223
  version: '0'
224
224
  requirements: []
225
- rubygems_version: 3.0.3
225
+ rubyforge_project:
226
+ rubygems_version: 2.7.6.2
226
227
  signing_key:
227
228
  specification_version: 4
228
229
  summary: Aids the development of APIs for clients and servers based on GRPC and Google