Update deadlock_retry plugin with latest upstream code.
This commit is contained in:
parent
edcd4af496
commit
2b9f430908
2 changed files with 33 additions and 2 deletions
|
@ -44,6 +44,7 @@ module DeadlockRetry
|
|||
begin
|
||||
transaction_without_deadlock_handling(*objects, &block)
|
||||
rescue ActiveRecord::StatementInvalid => error
|
||||
raise unless connection.open_transactions.zero?
|
||||
if DEADLOCK_ERROR_MESSAGES.any? { |msg| error.message =~ /#{Regexp.escape(msg)}/ }
|
||||
raise if retry_count >= MAXIMUM_RETRIES_ON_DEADLOCK
|
||||
retry_count += 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue