sidekiq-failures
sidekiq-failures copied to clipboard
Add 1 to retry_count To Properly Report Exhausted Failures
I noticed errors were not being reported when I used the :exhausted
option. Since the retry_count for Sidekiq starts at 0, if you have the retry count option manually set in your job it will never trigger an error to be reported when the retries are exhausted.
Let me know what you think!
Hey @mstruve, thanks for the contribution! It looks like this is likely only a bug in sidekiq 5+, when they moved all internal middleware out of the middleware chain. In <5 we rely on the ordering of the middleware for this to work properly (https://github.com/mhfs/sidekiq-failures/blob/master/lib/sidekiq/failures.rb#L84), and in >=5 the retry logic is permanently after our logic.
That being said, since we still support Sidekiq 4 would you be willing to adjust the logic to account for the version differences, and add some tests for it?
Hey @mcasper! Thanks for getting back to me, I am not currently using this gem anymore so I don't think I will have time to work on this. Please feel free to close and if I need it in the future I will get back to it. Thanks!