summaryrefslogtreecommitdiff
path: root/app/workers
diff options
context:
space:
mode:
authorHeinrich Lee Yu <hleeyu@gmail.com>2019-01-03 13:17:07 +0800
committerHeinrich Lee Yu <hleeyu@gmail.com>2019-01-07 11:21:30 +0800
commitf54290de751e365be0928c66bb75fd106bb7aa88 (patch)
treeda09c1505ede95633e7312080ab48986ae7382cb /app/workers
parente2698d5d7455d91fa94f9bbf1fc838f8cb142700 (diff)
downloadgitlab-ce-f54290de751e365be0928c66bb75fd106bb7aa88.tar.gz
Remove caching of CSV file49231-import-issues-csv
Load whole file in memory to simplify code
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/import_issues_csv_worker.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/workers/import_issues_csv_worker.rb b/app/workers/import_issues_csv_worker.rb
index 5d8c02a0605..d44fdfec8ae 100644
--- a/app/workers/import_issues_csv_worker.rb
+++ b/app/workers/import_issues_csv_worker.rb
@@ -3,12 +3,16 @@
class ImportIssuesCsvWorker
include ApplicationWorker
+ sidekiq_retries_exhausted do |job|
+ Upload.find(job['args'][2]).destroy
+ end
+
def perform(current_user_id, project_id, upload_id)
@user = User.find(current_user_id)
@project = Project.find(project_id)
@upload = Upload.find(upload_id)
- importer = Issues::ImportCsvService.new(@user, @project, @upload)
+ importer = Issues::ImportCsvService.new(@user, @project, @upload.build_uploader)
importer.execute
@upload.destroy