Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def wait(self):
return _compat.wait_func_accept_retry_state(self._wait)
def retry_error_callback(self):
return _compat.retry_error_callback_accept_retry_state(
self._retry_error_callback)
def stop(self):
return _compat.stop_func_accept_retry_state(self._stop)
@_compat.stop_dunder_call_accept_old_params
def __call__(self, retry_state):
return any(x(retry_state) for x in self.stops)
def retry(self):
return _compat.retry_func_accept_retry_state(self._retry)
def before(self):
return _compat.before_func_accept_retry_state(self._before)
@_compat.wait_dunder_call_accept_old_params
def __call__(self, retry_state):
result = self.start + (
self.increment * (retry_state.attempt_number - 1)
)
return max(0, min(result, self.max))
def __init__(self, *retries):
self.retries = tuple(_compat.retry_func_accept_retry_state(r)
for r in retries)
def after(self):
return _compat.after_func_accept_retry_state(self._after)
def __init__(self, *strategies):
self.strategies = [_compat.wait_func_accept_retry_state(strategy)
for strategy in strategies]