diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-11 21:06:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-11 21:06:15 +0300 |
commit | 0dfbcd8f8b1587a7e10eb79940a8dc13bd72c664 (patch) | |
tree | 769b7b5eaea4354498ca0b91945e4733895bba43 /app/workers | |
parent | cd631619f465a0eee2fe714e720f6b6312dd3e56 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/post_receive.rb | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/app/workers/post_receive.rb b/app/workers/post_receive.rb index a4b9ef18a3b..4f193e95faa 100644 --- a/app/workers/post_receive.rb +++ b/app/workers/post_receive.rb @@ -3,8 +3,6 @@ class PostReceive include ApplicationWorker - PIPELINE_PROCESS_LIMIT = 4 - def perform(gl_repository, identifier, changes, push_options = {}) project, repo_type = Gitlab::GlRepository.parse(gl_repository) @@ -49,8 +47,7 @@ class PostReceive expire_caches(post_received, post_received.project.repository) enqueue_repository_cache_update(post_received) - process_changes(Git::BranchPushService, project, user, push_options, changes.branch_changes) - process_changes(Git::TagPushService, project, user, push_options, changes.tag_changes) + process_ref_changes(project, user, push_options: push_options, changes: changes) update_remote_mirrors(post_received) after_project_changes_hooks(project, user, changes.refs, changes.repository_data) end @@ -75,18 +72,10 @@ class PostReceive ) end - def process_changes(service_class, project, user, push_options, changes) - return if changes.empty? - - changes.each do |change| - service_class.new( - project, - user, - change: change, - push_options: push_options, - create_pipelines: change[:index] < PIPELINE_PROCESS_LIMIT || Feature.enabled?(:git_push_create_all_pipelines, project) - ).execute - end + def process_ref_changes(project, user, params = {}) + return unless params[:changes].any? + + Git::ProcessRefChangesService.new(project, user, params).execute end def update_remote_mirrors(post_received) |