summaryrefslogtreecommitdiff
path: root/app/workers/export_csv_worker.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-20 18:38:24 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-20 18:38:24 +0000
commit983a0bba5d2a042c4a3bbb22432ec192c7501d82 (patch)
treeb153cd387c14ba23bd5a07514c7c01fddf6a78a0 /app/workers/export_csv_worker.rb
parenta2bddee2cdb38673df0e004d5b32d9f77797de64 (diff)
downloadgitlab-ce-983a0bba5d2a042c4a3bbb22432ec192c7501d82.tar.gz
Add latest changes from gitlab-org/gitlab@12-10-stable-ee
Diffstat (limited to 'app/workers/export_csv_worker.rb')
-rw-r--r--app/workers/export_csv_worker.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/app/workers/export_csv_worker.rb b/app/workers/export_csv_worker.rb
new file mode 100644
index 00000000000..9e2b3ad9bb4
--- /dev/null
+++ b/app/workers/export_csv_worker.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class ExportCsvWorker # rubocop:disable Scalability/IdempotentWorker
+ include ApplicationWorker
+
+ feature_category :issue_tracking
+ worker_resource_boundary :cpu
+
+ def perform(current_user_id, project_id, params)
+ @current_user = User.find(current_user_id)
+ @project = Project.find(project_id)
+
+ params.symbolize_keys!
+ params[:project_id] = project_id
+ params.delete(:sort)
+
+ issues = IssuesFinder.new(@current_user, params).execute
+
+ Issues::ExportCsvService.new(issues, @project).email(@current_user)
+ end
+end