diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-11-11 16:22:51 +0100 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-11-18 12:00:56 +0100 |
commit | 841a7c6897b23957286056498cc3f05ec4330d15 (patch) | |
tree | dba78089ddaa57ce67ac251a1565b17d54fa79b3 /app/workers/repository_fork_worker.rb | |
parent | 531177757eef772cc7ce5dd3898c3e6803187ed6 (diff) | |
download | gitlab-ce-841a7c6897b23957286056498cc3f05ec4330d15.tar.gz |
Store and show reason why import failed.
Diffstat (limited to 'app/workers/repository_fork_worker.rb')
-rw-r--r-- | app/workers/repository_fork_worker.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/app/workers/repository_fork_worker.rb b/app/workers/repository_fork_worker.rb index acd1c43f06b..2f991c52339 100644 --- a/app/workers/repository_fork_worker.rb +++ b/app/workers/repository_fork_worker.rb @@ -13,22 +13,20 @@ class RepositoryForkWorker end result = gitlab_shell.fork_repository(source_path, target_path) - unless result logger.error("Unable to fork project #{project_id} for repository #{source_path} -> #{target_path}") + project.update(import_error: "The project could not be forked.") project.import_fail - project.save return end - if project.valid_repo? - ProjectCacheWorker.perform_async(project.id) - project.import_finish - else - project.import_fail + unless project.valid_repo? logger.error("Project #{id} had an invalid repository after fork") + project.update(import_error: "The forked repository is invalid.") + project.import_fail + return end - project.save + project.import_finish end end |