summaryrefslogtreecommitdiff
path: root/app/workers
diff options
context:
space:
mode:
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/update_merge_requests_worker.rb10
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