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:
authorStan Hu <stanhu@gmail.com>2019-08-13 19:04:30 +0300
committerStan Hu <stanhu@gmail.com>2019-08-13 19:04:30 +0300
commite658f9603c99ca6a8ef4c0292b2cdab2916fb09e (patch)
tree57e0c03ea5dd676c7a53243bf3da20aefafc0ded /lib/gitlab/git_post_receive.rb
parent3702ab7317533896c7455357dd6643181666f22b (diff)
Only expire tag cache once per push
Previously each tag in a push would invoke the Gitaly `FindAllTags` RPC since the tag cache would be invalidated with every tag. We can eliminate those extraneous calls by expiring the tag cache once in `PostReceive` and taking advantage of the cached tags. Relates to https://gitlab.com/gitlab-org/gitlab-ce/issues/65795
Diffstat (limited to 'lib/gitlab/git_post_receive.rb')
-rw-r--r--lib/gitlab/git_post_receive.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/gitlab/git_post_receive.rb b/lib/gitlab/git_post_receive.rb
index 6c7f23a673c..24d752b8a4b 100644
--- a/lib/gitlab/git_post_receive.rb
+++ b/lib/gitlab/git_post_receive.rb
@@ -33,6 +33,12 @@ module Gitlab
end
end
+ def includes_tags?
+ enum_for(:changes_refs).any? do |_oldrev, _newrev, ref|
+ Gitlab::Git.tag_ref?(ref)
+ end
+ end
+
private
def deserialize_changes(changes)