Search code examples
rubyruby-on-rails-3delayed-job

Ensure to run code after rails `delayed job` fails or successess


Is there any way we can ensure certain code to run event after the delayed job is failed or succeeds just like we can write ensure block in exception handling?


Solution

  • What's wrong with the following approach?

    def delayed_job_method
      do_the_job
    ensure
     something
    end