Swaps Swaps - 2 months ago 8
Ruby Question

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?

Answer

What's wrong with the following approach?

def delayed_job_method
  do_the_job
ensure
 something
end