diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-27 18:09:21 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-27 18:09:21 +0000 |
commit | e0fa0638a422c3e20d4423c9bb69d79afc9c7d3d (patch) | |
tree | 9abb3c0706576bbda895fe9539a55556930606e2 /app/workers/pipeline_notification_worker.rb | |
parent | f8d15ca65390475e356b06dedc51e10ccd179f86 (diff) | |
download | gitlab-ce-e0fa0638a422c3e20d4423c9bb69d79afc9c7d3d.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/workers/pipeline_notification_worker.rb')
-rw-r--r-- | app/workers/pipeline_notification_worker.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/app/workers/pipeline_notification_worker.rb b/app/workers/pipeline_notification_worker.rb index e9081cc416f..72663fa19ae 100644 --- a/app/workers/pipeline_notification_worker.rb +++ b/app/workers/pipeline_notification_worker.rb @@ -8,12 +8,20 @@ class PipelineNotificationWorker # rubocop:disable Scalability/IdempotentWorker worker_resource_boundary :cpu # rubocop: disable CodeReuse/ActiveRecord - def perform(pipeline_id, recipients = nil) - pipeline = Ci::Pipeline.find_by(id: pipeline_id) + def perform(pipeline_id, args = {}) + case args + when Hash + ref_status = args[:ref_status] + recipients = args[:recipients] + else # TODO: backward compatible interface, can be removed in 12.10 + recipients = args + ref_status = nil + end + pipeline = Ci::Pipeline.find_by(id: pipeline_id) return unless pipeline - NotificationService.new.pipeline_finished(pipeline, recipients) + NotificationService.new.pipeline_finished(pipeline, ref_status: ref_status, recipients: recipients) end # rubocop: enable CodeReuse/ActiveRecord end |