summaryrefslogtreecommitdiff
path: root/app/controllers/projects_controller.rb
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-05-04 10:57:09 +0200
committerJames Lopez <james@jameslopez.es>2016-05-04 10:57:09 +0200
commitbd2ebf37e6c5aa07f8d29f4ac8c88fc8333a2297 (patch)
treecdfff0d1ecfe42ad3459409878d890a4f9289819 /app/controllers/projects_controller.rb
parent17cfce7adcee712f7e06d8ef0badf926f8eac105 (diff)
downloadgitlab-ce-bd2ebf37e6c5aa07f8d29f4ac8c88fc8333a2297.tar.gz
use worker in controller
Diffstat (limited to 'app/controllers/projects_controller.rb')
-rw-r--r--app/controllers/projects_controller.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 62f8b376c18..f15f20dcf52 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -191,8 +191,7 @@ class ProjectsController < Projects::ApplicationController
end
def export
- #TODO: Move to worker
- ::Projects::ImportExport::ExportService.new(@project, current_user).execute
+ @project.add_export_job(current_user_id: current_user.id)
redirect_to(
edit_project_path(@project),
@@ -201,7 +200,11 @@ class ProjectsController < Projects::ApplicationController
end
def download_export
- send_file export_project_path, disposition: 'attachment'
+ if export_project_path
+ send_file export_project_path, disposition: 'attachment'
+ else
+ render_404
+ end
end
def toggle_star