Skip to content

Commit bf83338

Browse files
Try rescuing exceptions and reenqueuing if necessary before re-raising
1 parent 2fd075e commit bf83338

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

lib/job-iteration/iteration.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ module Iteration
1818
define_callbacks :shutdown
1919
define_callbacks :complete
2020

21+
rescue_from(Exception) do
22+
reenqueue_iteration_job if reenqueue_iteration_job?
23+
raise
24+
end
25+
2126
after_perform(prepend: true, if: :reenqueue_iteration_job?) { reenqueue_iteration_job }
2227
end
2328

0 commit comments

Comments
 (0)