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:
authorStan Hu <stanhu@gmail.com>2015-09-01 10:56:40 +0300
committerStan Hu <stanhu@gmail.com>2015-09-11 10:34:04 +0300
commit9995f0806b29934cf498607f59d2c5ec358a0d5a (patch)
treead197f6e023553b20bb1317c57dddffe34da68b5 /app/controllers/projects/forks_controller.rb
parenta5bb85f8a234b2d8463656877712faf10f5bb842 (diff)
Import forked repositories asynchronously to prevent large repositories from timing out
Use import_status to track async import status and give feedback to the user Closes #2388 Closes #2400
Diffstat (limited to 'app/controllers/projects/forks_controller.rb')
-rw-r--r--app/controllers/projects/forks_controller.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/app/controllers/projects/forks_controller.rb b/app/controllers/projects/forks_controller.rb
index 9e72597ea87..8a785076bb7 100644
--- a/app/controllers/projects/forks_controller.rb
+++ b/app/controllers/projects/forks_controller.rb
@@ -13,10 +13,14 @@ class Projects::ForksController < Projects::ApplicationController
@forked_project = ::Projects::ForkService.new(project, current_user, namespace: namespace).execute
if @forked_project.saved? && @forked_project.forked?
- redirect_to(
- namespace_project_path(@forked_project.namespace, @forked_project),
- notice: 'Project was successfully forked.'
- )
+ if @forked_project.import_in_progress?
+ redirect_to namespace_project_import_path(@forked_project.namespace, @forked_project)
+ else
+ redirect_to(
+ namespace_project_path(@forked_project.namespace, @forked_project),
+ notice: 'Project was successfully forked.'
+ )
+ end
else
render :error
end