diff options
author | gpongelli <gabriele.pongelli@gmail.com> | 2017-03-07 15:59:20 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-03-07 15:59:20 +0300 |
commit | 4bcd900f14336df6c661a5c26b111eb4f039b7eb (patch) | |
tree | d5b8edc610b7bf0f00276603471f37a56b8590f0 /app | |
parent | ac9d792946deb17a402646e5481087e4d92f88ad (diff) |
Moved call of SystemHooksService from UpdateMergeRequestsWorker to GitPushServic…
Diffstat (limited to 'app')
-rw-r--r-- | app/services/git_push_service.rb | 2 | ||||
-rw-r--r-- | app/workers/system_hook_push_worker.rb | 8 | ||||
-rw-r--r-- | app/workers/update_merge_requests_worker.rb | 3 |
3 files changed, 10 insertions, 3 deletions
diff --git a/app/services/git_push_service.rb b/app/services/git_push_service.rb index dbe2fda27b5..bc7431c89a8 100644 --- a/app/services/git_push_service.rb +++ b/app/services/git_push_service.rb @@ -99,6 +99,8 @@ class GitPushService < BaseService UpdateMergeRequestsWorker .perform_async(@project.id, current_user.id, params[:oldrev], params[:newrev], params[:ref]) + SystemHookPushWorker.perform_async(build_push_data.dup, :push_hooks) + EventCreateService.new.push(@project, current_user, build_push_data) @project.execute_hooks(build_push_data.dup, :push_hooks) @project.execute_services(build_push_data.dup, :push_hooks) diff --git a/app/workers/system_hook_push_worker.rb b/app/workers/system_hook_push_worker.rb new file mode 100644 index 00000000000..e43bbe35de9 --- /dev/null +++ b/app/workers/system_hook_push_worker.rb @@ -0,0 +1,8 @@ +class SystemHookPushWorker + include Sidekiq::Worker + include DedicatedSidekiqQueue + + def perform(push_data, hook_id) + SystemHooksService.new.execute_hooks(push_data, hook_id) + end +end diff --git a/app/workers/update_merge_requests_worker.rb b/app/workers/update_merge_requests_worker.rb index acc4d858136..89ae17cef37 100644 --- a/app/workers/update_merge_requests_worker.rb +++ b/app/workers/update_merge_requests_worker.rb @@ -10,8 +10,5 @@ class UpdateMergeRequestsWorker return unless user MergeRequests::RefreshService.new(project, user).execute(oldrev, newrev, ref) - - push_data = Gitlab::DataBuilder::Push.build(project, user, oldrev, newrev, ref, []) - SystemHooksService.new.execute_hooks(push_data, :push_hooks) end end |