diff options
author | Heinrich Lee Yu <hleeyu@gmail.com> | 2019-01-03 13:17:07 +0800 |
---|---|---|
committer | Heinrich Lee Yu <hleeyu@gmail.com> | 2019-01-07 11:21:30 +0800 |
commit | f54290de751e365be0928c66bb75fd106bb7aa88 (patch) | |
tree | da09c1505ede95633e7312080ab48986ae7382cb /app/workers | |
parent | e2698d5d7455d91fa94f9bbf1fc838f8cb142700 (diff) | |
download | gitlab-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.rb | 6 |
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 |