| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Permit application code to reset / fix-up state before retrying. See: #3889
There was a problem hiding this comment.
LGTM though I think you should let @jonparrott have a look before merging
Sorry, something went wrong.
| sleep_generator (Iterator[float]): An infinite iterator that determines | ||
| how long to sleep between retries. | ||
| deadline (float): How long to keep retrying the target. | ||
| on_error(Callable): A function to call while processing a retryable |
|
|
||
| Args: | ||
| func (Callable): The callable to add retry behavior to. | ||
| on_error(Callable): A function to call while processing a |
| raise ValueError() | ||
| return 42 | ||
|
|
||
| result = retry.retry_target( |
|
|
||
| result = retry.retry_target( | ||
| target, predicate, range(10), None, on_error=on_error) | ||
|
|
There was a problem hiding this comment.
looks mostly good, just a few questions.
Sorry, something went wrong.
| raise | ||
| last_exc = exc | ||
| if on_error is not None: | ||
| on_error() |
| sleep_generator (Iterator[float]): An infinite iterator that determines | ||
| how long to sleep between retries. | ||
| deadline (float): How long to keep retrying the target. | ||
| on_error(Callable): A function to call while processing a retryable |
| self._deadline = deadline | ||
|
|
||
| def __call__(self, func): | ||
| def __call__(self, func, on_error=None): |
Permit application code to reset / fix-up state before retrying.
| Back | FazBrowse Home | New Git URL |
Permit application code to reset / fix-up state before retrying.
See: #3889