Skip to content

Commit 4a5461d

Browse files
author
peevo
committed
Fix interceptor
1 parent 936b6aa commit 4a5461d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

yandexcloud/_retry_interceptor.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ def retry():
111111
raise _RetryCall()
112112

113113
try:
114-
return continuation(client_call_details, request)
114+
result = continuation(client_call_details, request)
115+
if isinstance(result, grpc.RpcError):
116+
raise result
117+
return result
115118
except grpc.RpcError as e:
116119
# no retries left
117120
if 0 <= self.__max_retry_count <= attempt:

yandexcloud/_sdk.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ def __init__(self, interceptor=None, **kwargs):
1515
if interceptor is None:
1616
interceptor = RetryInterceptor(
1717
max_retry_count=5,
18-
per_call_timeout=1,
18+
per_call_timeout=30,
19+
back_off_func=lambda attempt: attempt * 2,
1920
)
2021
self._default_interceptor = interceptor
2122
self.helpers = _helpers.Helpers(self)

0 commit comments

Comments
 (0)