Skip to content

Commit

Permalink
Reset error-related attributes of a background migration job when ret…
Browse files Browse the repository at this point in the history
…rying
  • Loading branch information
fatkodima committed Mar 2, 2024
1 parent d956069 commit 9cebfd0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/online_migrations/background_migrations/migration_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ def retry
status: self.class.statuses[:enqueued],
attempts: 0,
started_at: nil,
finished_at: nil
finished_at: nil,
error_class: nil,
error_message: nil,
backtrace: nil
)
end

Expand Down
3 changes: 3 additions & 0 deletions test/background_migrations/migration_job_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ def test_retry
assert_equal 0, j.attempts
assert_nil j.started_at
assert_nil j.finished_at
assert_nil j.error_class
assert_nil j.error_message
assert_nil j.backtrace
end

private
Expand Down

0 comments on commit 9cebfd0

Please sign in to comment.