Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/concerns/cross_database_modification.rb')
-rw-r--r--app/models/concerns/cross_database_modification.rb36
1 files changed, 12 insertions, 24 deletions
diff --git a/app/models/concerns/cross_database_modification.rb b/app/models/concerns/cross_database_modification.rb
index dea62f03f91..273d5f35e76 100644
--- a/app/models/concerns/cross_database_modification.rb
+++ b/app/models/concerns/cross_database_modification.rb
@@ -80,34 +80,22 @@ module CrossDatabaseModification
end
def transaction(**options, &block)
- if track_gitlab_schema_in_current_transaction?
- super(**options) do
- # Hook into current transaction to ensure that once
- # the `COMMIT` is executed the `gitlab_transactions_stack`
- # will be allowing to execute `after_commit_queue`
- record = TransactionStackTrackRecord.new(self, gitlab_schema)
-
- begin
- connection.current_transaction.add_record(record)
-
- yield
- ensure
- record.done!
- end
+ super(**options) do
+ # Hook into current transaction to ensure that once
+ # the `COMMIT` is executed the `gitlab_transactions_stack`
+ # will be allowing to execute `after_commit_queue`
+ record = TransactionStackTrackRecord.new(self, gitlab_schema)
+
+ begin
+ connection.current_transaction.add_record(record)
+
+ yield
+ ensure
+ record.done!
end
- else
- super(**options, &block)
end
end
- def track_gitlab_schema_in_current_transaction?
- return false unless Feature::FlipperFeature.table_exists?
-
- Feature.enabled?(:track_gitlab_schema_in_current_transaction)
- rescue ActiveRecord::NoDatabaseError, PG::ConnectionBad
- false
- end
-
def gitlab_schema
case self.name
when 'ActiveRecord::Base', 'ApplicationRecord'