Skip to content

Commit

Permalink
Try rescuing exceptions and reenqueuing if necessary before re-raising
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianna-chang-shopify committed Feb 23, 2021
1 parent ea23d3e commit 5340d0f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/job-iteration/iteration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ module Iteration
define_callbacks :shutdown
define_callbacks :complete

rescue_from(Exception) do
reenqueue_iteration_job if reenqueue_iteration_job?
raise
end

after_perform(prepend: true, if: :reenqueue_iteration_job?) { reenqueue_iteration_job }
end

Expand Down

0 comments on commit 5340d0f

Please sign in to comment.