Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access to retry_number from decorated method? #75

Open
bedge opened this issue Jan 22, 2018 · 0 comments
Open

Access to retry_number from decorated method? #75

bedge opened this issue Jan 22, 2018 · 0 comments

Comments

@bedge
Copy link

bedge commented Jan 22, 2018

I'd like to log the retry attempt_number in the wrapped/decorated method.
Is there any provision to access this from the method being retried?

eg:

@retry(retry_on_exception=retryable_write_exceptions, wrap_exception=True,
       wait_exponential_multiplier=10000, wait_exponential_max=600000)
def retry_read(flakey_method):
    try:
        retval = flakey_method()
    except Exception as e:
        logger.error('Retry number: {}'.format(**retry_wrappers_attempt_number**))
    return retval
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant