2019-12-21 20:55:43 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-05-24 23:13:21 +05:30
|
|
|
# TODO: Worker can be removed in 13.2:
|
|
|
|
# https://gitlab.com/gitlab-org/gitlab/-/issues/218231
|
2020-04-08 14:13:33 +05:30
|
|
|
class NewReleaseWorker # rubocop:disable Scalability/IdempotentWorker
|
2019-12-21 20:55:43 +05:30
|
|
|
include ApplicationWorker
|
|
|
|
|
|
|
|
queue_namespace :notifications
|
|
|
|
feature_category :release_orchestration
|
2020-03-13 15:44:24 +05:30
|
|
|
weight 2
|
2019-12-21 20:55:43 +05:30
|
|
|
|
|
|
|
def perform(release_id)
|
2019-12-26 22:10:19 +05:30
|
|
|
release = Release.preloaded.find_by_id(release_id)
|
2019-12-21 20:55:43 +05:30
|
|
|
return unless release
|
|
|
|
|
|
|
|
NotificationService.new.send_new_release_notifications(release)
|
|
|
|
end
|
|
|
|
end
|