diff options
author | micael.bergeron <micaelbergeron@gmail.com> | 2017-10-31 09:48:10 -0400 |
---|---|---|
committer | micael.bergeron <micaelbergeron@gmail.com> | 2017-10-31 09:48:10 -0400 |
commit | 7799a9bc442738935104d3b047c257e5c5884d95 (patch) | |
tree | 6f1d4ea1ca06b031b4c12c67371d28a1e12c6a28 /app | |
parent | 8266c78cd0f7a868bc0329ac61d24af797a19644 (diff) | |
download | gitlab-ce-7799a9bc442738935104d3b047c257e5c5884d95.tar.gz |
add metrics tagging to the sidekiq middleware
Diffstat (limited to 'app')
-rw-r--r-- | app/workers/update_merge_requests_worker.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/workers/update_merge_requests_worker.rb b/app/workers/update_merge_requests_worker.rb index 89ae17cef37..f1e43bea8b3 100644 --- a/app/workers/update_merge_requests_worker.rb +++ b/app/workers/update_merge_requests_worker.rb @@ -2,6 +2,12 @@ class UpdateMergeRequestsWorker include Sidekiq::Worker include DedicatedSidekiqQueue + attr_reader :targets # for metrics tags + + def initialize + @targets = {} + end + def perform(project_id, user_id, oldrev, newrev, ref) project = Project.find_by(id: project_id) return unless project @@ -9,6 +15,10 @@ class UpdateMergeRequestsWorker user = User.find_by(id: user_id) return unless user + @targets = { + project_id: project_id, + user_id: user_id + } MergeRequests::RefreshService.new(project, user).execute(oldrev, newrev, ref) end end |