Skip to content

Commit

Permalink
feat: Set retry and timeout values for Cloud ResourceSettings v1 API (#…
Browse files Browse the repository at this point in the history
…15)

PiperOrigin-RevId: 384962120

Source-Link: googleapis/googleapis@a9338c6

Source-Link: googleapis/googleapis-gen@d65bd01
  • Loading branch information
gcf-owl-bot[bot] authored Jul 16, 2021
1 parent faf3c6c commit 5d4db63
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,17 @@ async def get_setting(
# and friendly error handling.
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.get_setting,
default_timeout=None,
default_retry=retries.Retry(
initial=1.0,
maximum=10.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=60.0,
),
default_timeout=60.0,
client_info=DEFAULT_CLIENT_INFO,
)

Expand Down Expand Up @@ -390,7 +400,17 @@ async def update_setting(
# and friendly error handling.
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.update_setting,
default_timeout=None,
default_retry=retries.Retry(
initial=1.0,
maximum=10.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=60.0,
),
default_timeout=60.0,
client_info=DEFAULT_CLIENT_INFO,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,34 @@ def _prep_wrapped_messages(self, client_info):
client_info=client_info,
),
self.get_setting: gapic_v1.method.wrap_method(
self.get_setting, default_timeout=None, client_info=client_info,
self.get_setting,
default_retry=retries.Retry(
initial=1.0,
maximum=10.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=60.0,
),
default_timeout=60.0,
client_info=client_info,
),
self.update_setting: gapic_v1.method.wrap_method(
self.update_setting, default_timeout=None, client_info=client_info,
self.update_setting,
default_retry=retries.Retry(
initial=1.0,
maximum=10.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=60.0,
),
default_timeout=60.0,
client_info=client_info,
),
}

Expand Down

0 comments on commit 5d4db63

Please sign in to comment.