Issuables: Move some code from create services to Sidekiq workers
What does this MR do?
It moves some code from Issues::CreateService
and MergeRequests::CreateService
to workers (NewIssueWorker
, NewMergeRequestWorker
) in order to improve performance.
This is the first part of improving performance when creating new issuables. There are probably more methods we can move (issuable.cache_merge_request_closes_issues!(current_user)
for MRs or user_agent_detail_service.create
for issues)
Are there points in the code the reviewer needs to double check?
Why was this MR needed?
Creating issuables is slow as described in the related issue. after_create
takes reasonable amount of time and even moving only create_cross_references!
should save some time. (https://gitlab.com/gitlab-org/gitlab-ce/issues/32844#note_30957824)
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added - Tests
-
Added for this feature/bug -
All builds are passing
-
- Review
-
Has been reviewed by UX -
Has been reviewed by Frontend -
Has been reviewed by Backend -
Has been reviewed by Database
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Branch has no merge conflicts with master
(if it does - rebase it please) -
Squashed related commits together