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:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-03-01 18:22:06 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-03-01 18:22:06 +0300
commit2ccb5c91c82c780c905ee77da144f17825610487 (patch)
tree92fd3f6a2638474bc0725714a31da365fd80a301 /app/models/namespaces/traversal/linear.rb
parentfbc7e1f503da80d993b970a74637a1edf53f7ab6 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/namespaces/traversal/linear.rb')
-rw-r--r--app/models/namespaces/traversal/linear.rb9
1 files changed, 1 insertions, 8 deletions
diff --git a/app/models/namespaces/traversal/linear.rb b/app/models/namespaces/traversal/linear.rb
index 99a5b8cb063..1963745cf4d 100644
--- a/app/models/namespaces/traversal/linear.rb
+++ b/app/models/namespaces/traversal/linear.rb
@@ -44,22 +44,15 @@ module Namespaces
included do
before_update :lock_both_roots, if: -> { sync_traversal_ids? && parent_id_changed? }
after_update :sync_traversal_ids, if: -> { sync_traversal_ids? && saved_change_to_parent_id? }
- # sync traversal_ids on namespace create, which can happen quite early within a transaction, thus keeping the lock on root namespace record
- # for a relatively long time, e.g. creating the project namespace when a project is being created.
- after_create :sync_traversal_ids, if: -> { sync_traversal_ids? && !sync_traversal_ids_before_commit? }
# This uses rails internal before_commit API to sync traversal_ids on namespace create, right before transaction is committed.
# This helps reduce the time during which the root namespace record is locked to ensure updated traversal_ids are valid
- before_commit :sync_traversal_ids, on: [:create], if: -> { sync_traversal_ids? && sync_traversal_ids_before_commit? }
+ before_commit :sync_traversal_ids, on: [:create], if: -> { sync_traversal_ids? }
end
def sync_traversal_ids?
Feature.enabled?(:sync_traversal_ids, root_ancestor, default_enabled: :yaml)
end
- def sync_traversal_ids_before_commit?
- Feature.enabled?(:sync_traversal_ids_before_commit, root_ancestor, default_enabled: :yaml)
- end
-
def use_traversal_ids?
return false unless Feature.enabled?(:use_traversal_ids, default_enabled: :yaml)