nesquena / backburner

Simple and reliable beanstalkd job queue for ruby
http://nesquena.github.com/backburner
MIT License
428 stars 68 forks source link

Hook documentation is misleading about the ability to bury a job #172

Open contentfree opened 2 years ago

contentfree commented 2 years ago

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.

nesquena commented 2 years ago

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.