Search code examples
ruby-on-railsresque-retry

How to call the resque-cleaner methods automatically whenever a job fails?


https://github.com/ono/resque-cleaner

this documentation explains how to use the methods in console. what if i wanted to call the method to requeue for a specific job as soon as it fails.


Solution

  • I am an author of resque-cleaner. I am not really sure what you want to do, though, let me try to answer your question.

    At first, maybe you want to check Resque's on_failure hook? https://github.com/defunkt/resque/blob/master/docs/HOOKS.md

    You can use resque-cleaner in the hook as well as anywhere in your code. It is not limited to be used in console. The document is just written based on an assumption which it is used on console most of the case.