Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-03-24 15:15:59 +0300
committerDouwe Maan <douwe@gitlab.com>2015-03-31 13:52:20 +0300
commit2cfd0b59aeb410c1541530ca3eb5f5c472b978e0 (patch)
tree6456eb0d262036234c851dd516f3edd12cc0f833 /app/controllers/projects/repositories_controller.rb
parent33a8f53f7a8fdc40d0f0ee4245258c8dba99198a (diff)
Archive repositories in background worker.
Diffstat (limited to 'app/controllers/projects/repositories_controller.rb')
-rw-r--r--app/controllers/projects/repositories_controller.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/controllers/projects/repositories_controller.rb b/app/controllers/projects/repositories_controller.rb
index cbb888b25e8..112365ba91a 100644
--- a/app/controllers/projects/repositories_controller.rb
+++ b/app/controllers/projects/repositories_controller.rb
@@ -15,14 +15,18 @@ class Projects::RepositoriesController < Projects::ApplicationController
render_404 and return
end
- file_path = ArchiveRepositoryService.new.execute(@project, params[:ref], params[:format])
+ begin
+ file_path = ArchiveRepositoryService.new(@project, params[:ref], params[:format]).execute
+ rescue
+ return render_404
+ end
if file_path
# Send file to user
response.headers["Content-Length"] = File.open(file_path).size.to_s
send_file file_path
else
- render_404
+ redirect_to request.fullpath
end
end
end