diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 03:11:16 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 03:11:16 +0300 |
commit | 122ed7ce8c6fd1e433933b4d397d3f4ed4269c49 (patch) | |
tree | 44fcf523d702f1004ff5c035ab32f761cef8707e /app/services/post_receive_service.rb | |
parent | c75f38907c1b28adf5f57a8ad34df9f86c36d4e7 (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.rb | 7 |
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) |