diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-09-14 14:56:13 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-09-14 14:56:13 +0000 |
commit | c0c314c6bfe3640d724955d7d4eae7b9f7e1d2b1 (patch) | |
tree | 3923e3cb650f4e5873c50326a21941e789ca69af /app/controllers | |
parent | e72b9ffe98996e8fb7a104ab4b1ce8671b1186c8 (diff) | |
parent | 9995f0806b29934cf498607f59d2c5ec358a0d5a (diff) | |
download | gitlab-ce-c0c314c6bfe3640d724955d7d4eae7b9f7e1d2b1.tar.gz |
Merge branch 'forked-repo-creation-async' into 'master'
Import forked repositories asynchronously to prevent large repositories from timing out
Preserve synchronous mode of adding a repository since some tasks (e.g. restore/check) require the former.
One side bug fix is that the `ProjectCacheWorker` is also run, updating the repository size and commit numbers properly. Previously all the values were set to 0 when a project were forked.
* Closes #2388
* Closes #2400
See merge request !1231
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/projects/forks_controller.rb | 12 |
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 |