diff options
author | Andrew Newdigate <andrew@gitlab.com> | 2019-06-25 09:15:35 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2019-06-25 09:15:35 +0000 |
commit | 84cb1bdaedbe192c5594d7586117191b865d8347 (patch) | |
tree | 0b181b9aee69d9230dc04de36b49f0ee49b6ceb1 /config/initializers | |
parent | e6a41c14e023627dba24ec321ddc0794fef41833 (diff) | |
download | gitlab-ce-84cb1bdaedbe192c5594d7586117191b865d8347.tar.gz |
Refactor inside_transaction? to Gitlab::Database
This is a small change to move AfterCommitQueue.inside_transaction?
to Gitlab::Database.inside_transaction? Since this change is required
by different changes which may not arrive in sequence, it's easier
to extract this change out on it's own.
Diffstat (limited to 'config/initializers')
-rw-r--r-- | config/initializers/forbid_sidekiq_in_transactions.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/config/initializers/forbid_sidekiq_in_transactions.rb b/config/initializers/forbid_sidekiq_in_transactions.rb index deb94d7dbce..a69f1ba090e 100644 --- a/config/initializers/forbid_sidekiq_in_transactions.rb +++ b/config/initializers/forbid_sidekiq_in_transactions.rb @@ -17,7 +17,7 @@ module Sidekiq module NoEnqueueingFromTransactions %i(perform_async perform_at perform_in).each do |name| define_method(name) do |*args| - if !Sidekiq::Worker.skip_transaction_check && AfterCommitQueue.inside_transaction? + if !Sidekiq::Worker.skip_transaction_check && Gitlab::Database.inside_transaction? begin raise Sidekiq::Worker::EnqueueFromTransactionError, <<~MSG `#{self}.#{name}` cannot be called inside a transaction as this can lead to |