Compute appropriate wait time between RPC attempts.
(num_attempts)
| 185 | |
| 186 | |
| 187 | def _compute_backoff_seconds(num_attempts): |
| 188 | """Compute appropriate wait time between RPC attempts.""" |
| 189 | jitter_factor = random.uniform( |
| 190 | _GRPC_RETRY_JITTER_FACTOR_MIN, _GRPC_RETRY_JITTER_FACTOR_MAX |
| 191 | ) |
| 192 | backoff_secs = (_GRPC_RETRY_EXPONENTIAL_BASE**num_attempts) * jitter_factor |
| 193 | return backoff_secs |
| 194 | |
| 195 | |
| 196 | def call_with_retries(api_method, request, clock=None): |
no outgoing calls
no test coverage detected
searching dependent graphs…