backburner icon indicating copy to clipboard operation
backburner copied to clipboard

Hook documentation is misleading about the ability to bury a job

Open contentfree opened this issue 4 years ago • 1 comments

The docs for hooks give a couple examples for an on_failure_bury method that goes on to call self.bury. The problem is that self.bury isn't a method and implementing a hook like this will raise NoMethodErrors. bury is a method on a Backburner::Job but job classes are usually just plain ruby objects that respond to perform.

I think a fix would be to pass the job into the on_failure hooks.

contentfree avatar Sep 30 '21 07:09 contentfree

Good call out, thanks for surfacing this. I agree with your proposed fix as well as an easy way to go. Or simply removing any documentation related to those hooks and removing that method altogether.

nesquena avatar Oct 01 '21 23:10 nesquena