resque-retry
resque-retry copied to clipboard
Need to know the retry instance
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.
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.