diff options
author | Jarka Kadlecova <jarka@gitlab.com> | 2017-08-01 14:38:45 +0200 |
---|---|---|
committer | Jarka Kadlecova <jarka@gitlab.com> | 2017-08-07 15:57:56 +0200 |
commit | 9ef3c431e4859e1bc03267735b956d5920d5dd42 (patch) | |
tree | 5a4063641e79766c249924f5095e6c328a279846 /app/services/issues | |
parent | faa2a123911eaf84bb57163ea7af759d4632601b (diff) | |
download | gitlab-ce-9ef3c431e4859e1bc03267735b956d5920d5dd42.tar.gz |
Move some after_create parts to worker to improve performance32844-issuables-performance
Diffstat (limited to 'app/services/issues')
-rw-r--r-- | app/services/issues/create_service.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/services/issues/create_service.rb b/app/services/issues/create_service.rb index 718a7ac1f22..9114f0ccc81 100644 --- a/app/services/issues/create_service.rb +++ b/app/services/issues/create_service.rb @@ -15,11 +15,14 @@ module Issues def before_create(issue) spam_check(issue, current_user) issue.move_to_end + + user = current_user + issue.run_after_commit do + NewIssueWorker.perform_async(issue.id, user.id) + end end def after_create(issuable) - event_service.open_issue(issuable, current_user) - notification_service.new_issue(issuable, current_user) todo_service.new_issue(issuable, current_user) user_agent_detail_service.create resolve_discussions_with_issue(issuable) |