diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 11:10:13 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 11:10:13 +0000 |
commit | 0ea3fcec397b69815975647f5e2aa5fe944a8486 (patch) | |
tree | 7979381b89d26011bcf9bdc989a40fcc2f1ed4ff /app/models/namespaces/traversal/linear.rb | |
parent | 72123183a20411a36d607d70b12d57c484394c8e (diff) | |
download | gitlab-ce-0ea3fcec397b69815975647f5e2aa5fe944a8486.tar.gz |
Add latest changes from gitlab-org/gitlab@15-1-stable-eev15.1.0-rc42
Diffstat (limited to 'app/models/namespaces/traversal/linear.rb')
-rw-r--r-- | app/models/namespaces/traversal/linear.rb | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/app/models/namespaces/traversal/linear.rb b/app/models/namespaces/traversal/linear.rb index b0350b0288f..687fa6a5334 100644 --- a/app/models/namespaces/traversal/linear.rb +++ b/app/models/namespaces/traversal/linear.rb @@ -42,11 +42,11 @@ module Namespaces UnboundedSearch = Class.new(StandardError) 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? } + before_update :lock_both_roots, if: -> { parent_id_changed? } + after_update :sync_traversal_ids, if: -> { saved_change_to_parent_id? } # 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? } + before_commit :sync_traversal_ids, on: [:create] end class_methods do @@ -76,10 +76,6 @@ module Namespaces end end - def sync_traversal_ids? - Feature.enabled?(:sync_traversal_ids, root_ancestor) - end - def use_traversal_ids? return false unless Feature.enabled?(:use_traversal_ids) |