One of the PRs I had on retrying [1] was to support a generic wait hook, suitable for logging or other per-retry operations.
I was looking at tenacity and wanted to confirm how I'd do this:
def logged_wait(*args, **kwargs):
# no-op wait just to log on each attempt
print("Yet another logged attempt")
return 0
@retry(wait=wait_combine(logged_wait, wait_fixed(1000)), ...)
def my_retried_func():
# interesting retryable stuff here
Is this about right?
[1] rholder/retrying#50
One of the PRs I had on retrying [1] was to support a generic wait hook, suitable for logging or other per-retry operations.
I was looking at tenacity and wanted to confirm how I'd do this:
Is this about right?
[1] rholder/retrying#50