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

Need to know the retry instance #175

Open
richard0000 opened this issue Jun 7, 2023 · 1 comment
Open

Need to know the retry instance #175

richard0000 opened this issue Jun 7, 2023 · 1 comment

Comments

@richard0000
Copy link

In order to only run certain logic when the job is retried a specific amount of times, I need to know the retry instance that's begin run.

So let's say I want to raise a specific exception when I know the job was already retried 3 times.

I couldn't find a way to do so with the current interface, reading the documentation. Is there any way? If not, is it reasonable to consider implementing it?

Thanks in advance.

@jzaleski
Copy link
Collaborator

jzaleski commented Jun 8, 2023

It looks like you can access this through the retry_attempt accessor which is initialized in code, but backed in redis, you could also reconstruct the key if necessary and query redis as well -- I hope this helps.

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

2 participants