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>2021-07-27 00:08:38 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-27 00:08:38 +0300
commit936d15143b786f841bf0ee8e2458215ee010f33e (patch)
treef850c872c4d0328358ebdec10a343e8c63e519ce /lib/gitlab/markdown_cache
parentf57f1c6cd8a89454bb8a4a1b965738dcc8007d5d (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/markdown_cache')
-rw-r--r--lib/gitlab/markdown_cache/active_record/extension.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/markdown_cache/active_record/extension.rb b/lib/gitlab/markdown_cache/active_record/extension.rb
index 1de890c84f9..af94884f1a7 100644
--- a/lib/gitlab/markdown_cache/active_record/extension.rb
+++ b/lib/gitlab/markdown_cache/active_record/extension.rb
@@ -10,7 +10,9 @@ module Gitlab
# Using before_update here conflicts with elasticsearch-model somehow
before_create :refresh_markdown_cache, if: :invalidated_markdown_cache?
before_update :refresh_markdown_cache, if: :invalidated_markdown_cache?
- after_save :store_mentions!, if: :mentionable_attributes_changed?
+ # The import case needs to be fixed to avoid large number of
+ # SQL queries: https://gitlab.com/gitlab-org/gitlab/-/issues/21801
+ after_save :store_mentions!, if: :mentionable_attributes_changed?, unless: ->(obj) { obj.is_a?(Importable) && obj.importing? }
end
# Always exclude _html fields from attributes (including serialization).