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-08-19 03:11:16 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-19 03:11:16 +0300
commit122ed7ce8c6fd1e433933b4d397d3f4ed4269c49 (patch)
tree44fcf523d702f1004ff5c035ab32f761cef8707e /app/services/post_receive_service.rb
parentc75f38907c1b28adf5f57a8ad34df9f86c36d4e7 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/post_receive_service.rb')
-rw-r--r--app/services/post_receive_service.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/services/post_receive_service.rb b/app/services/post_receive_service.rb
index a6d49f03c0b..f5638b0aa40 100644
--- a/app/services/post_receive_service.rb
+++ b/app/services/post_receive_service.rb
@@ -17,13 +17,18 @@ class PostReceiveService
response = Gitlab::InternalPostReceive::Response.new
push_options = Gitlab::PushOptions.new(params[:push_options])
+ mr_options = push_options.get(:merge_request)
response.reference_counter_decreased = Gitlab::ReferenceCounter.new(params[:gl_repository]).decrease
+ # The PostReceive worker will normally invalidate the cache. However, it
+ # runs asynchronously. If push options require us to create a new merge
+ # request synchronously, we can't rely on that, so invalidate the cache here
+ repository&.expire_branches_cache if mr_options&.fetch(:create, false)
+
PostReceive.perform_async(params[:gl_repository], params[:identifier],
params[:changes], push_options.as_json)
- mr_options = push_options.get(:merge_request)
if mr_options.present?
message = process_mr_push_options(mr_options, params[:changes])
response.add_alert_message(message)