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
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-03 12:07:16 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-03 12:07:16 +0300
commit2b67531b0fd7c94cb1d8618166c4193f40ea5a1f (patch)
treee6cefd08d250a04fde66e03de7c59f1e535463fd /app
parented58c351374814027fbb2383ddecb9fa38de0c57 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/workers/post_receive.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/app/workers/post_receive.rb b/app/workers/post_receive.rb
index 843ba3e980e..63a32083b5d 100644
--- a/app/workers/post_receive.rb
+++ b/app/workers/post_receive.rb
@@ -43,7 +43,8 @@ class PostReceive
return false unless user
# We only need to expire certain caches once per push
- expire_caches(post_received)
+ expire_caches(post_received, post_received.project.repository)
+ enqueue_repository_cache_update(post_received)
post_received.enum_for(:changes_refs).with_index do |(oldrev, newrev, ref), index|
service_klass =
@@ -72,18 +73,14 @@ class PostReceive
after_project_changes_hooks(post_received, user, refs.to_a, changes)
end
- # Expire the project, branch, and tag cache once per push. Schedule an
- # update for the repository size and commit count if necessary.
- def expire_caches(post_received)
- project = post_received.project
-
- project.repository.expire_status_cache if project.empty_repo?
- project.repository.expire_branches_cache if post_received.includes_branches?
- project.repository.expire_caches_for_tags if post_received.includes_tags?
-
- enqueue_repository_cache_update(post_received)
+ # Expire the repository status, branch, and tag cache once per push.
+ def expire_caches(post_received, repository)
+ repository.expire_status_cache if repository.empty?
+ repository.expire_branches_cache if post_received.includes_branches?
+ repository.expire_caches_for_tags if post_received.includes_tags?
end
+ # Schedule an update for the repository size and commit count if necessary.
def enqueue_repository_cache_update(post_received)
stats_to_invalidate = [:repository_size]
stats_to_invalidate << :commit_count if post_received.includes_default_branch?
@@ -110,6 +107,9 @@ class PostReceive
user = identify_user(post_received)
return false unless user
+ # We only need to expire certain caches once per push
+ expire_caches(post_received, post_received.project.wiki.repository)
+
::Git::WikiPushService.new(post_received.project, user, changes: post_received.enum_for(:changes_refs)).execute
end