2018-06-27 07:23:28 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-02-19 18:09:10 +00:00
|
|
|
class NewIssueWorker # rubocop:disable Scalability/IdempotentWorker
|
2017-11-28 16:08:30 +00:00
|
|
|
include ApplicationWorker
|
2017-08-01 12:38:45 +00:00
|
|
|
include NewIssuable
|
|
|
|
|
2019-10-18 11:11:44 +00:00
|
|
|
feature_category :issue_tracking
|
2020-03-02 18:07:42 +00:00
|
|
|
urgency :high
|
2019-10-30 15:14:17 +00:00
|
|
|
worker_resource_boundary :cpu
|
2020-01-24 18:09:00 +00:00
|
|
|
weight 2
|
2019-10-18 11:11:44 +00:00
|
|
|
|
2017-08-01 12:38:45 +00:00
|
|
|
def perform(issue_id, user_id)
|
2017-08-08 07:41:27 +00:00
|
|
|
return unless objects_found?(issue_id, user_id)
|
2017-08-01 12:38:45 +00:00
|
|
|
|
2020-09-04 15:08:46 +00:00
|
|
|
::EventCreateService.new.open_issue(issuable, user)
|
|
|
|
::NotificationService.new.new_issue(issuable, user)
|
2017-08-01 12:38:45 +00:00
|
|
|
issuable.create_cross_references!(user)
|
|
|
|
end
|
|
|
|
|
|
|
|
def issuable_class
|
|
|
|
Issue
|
|
|
|
end
|
|
|
|
end
|