Skip to content

Commit

Permalink
Improved code
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Nov 9, 2024
1 parent 0c78b28 commit 4963a65
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/strong_migrations/checker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def reset
@timeouts_set = false
@committed = false
@transaction_disabled = false
@skip_retries = false
end

def self.safety_assured
Expand Down Expand Up @@ -123,7 +124,7 @@ def perform_method(method, *args)
begin
remove_invalid_index_if_needed(*args)
ensure
remove_instance_variable(:@skip_retries)
@skip_retries = false
end
end
yield
Expand Down Expand Up @@ -243,7 +244,7 @@ def retry_lock_timeouts?(method)
StrongMigrations.lock_timeout_retries > 0 &&
!in_transaction? &&
method != :transaction &&
!defined?(@skip_retries)
!@skip_retries
)
end

Expand Down

0 comments on commit 4963a65

Please sign in to comment.