diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-15 18:06:01 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-15 18:06:01 +0000 |
commit | 7b8ec6e718331dd1f8330f08f49f01ba2c20b84c (patch) | |
tree | 560992bd23b96c85e8b006258a8ece3fb25d088e /lib/backup | |
parent | 03087faa6b679cd82a8a7b5f6491edc414ed91eb (diff) | |
download | gitlab-ce-7b8ec6e718331dd1f8330f08f49f01ba2c20b84c.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/backup')
-rw-r--r-- | lib/backup/repository.rb | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/backup/repository.rb b/lib/backup/repository.rb index c87466de357..974e32ce17c 100644 --- a/lib/backup/repository.rb +++ b/lib/backup/repository.rb @@ -41,12 +41,6 @@ module Backup end end - def prepare_directories - Gitlab.config.repositories.storages.each do |name, _repository_storage| - Gitlab::GitalyClient::StorageService.new(name).delete_all_repositories - end - end - def backup_project(project) path_to_project_bundle = path_to_bundle(project) Gitlab::GitalyClient::RepositoryService.new(project.repository) @@ -75,13 +69,13 @@ module Backup end def restore - prepare_directories - Project.find_each(batch_size: 1000) do |project| progress.print " * #{project.full_path} ... " path_to_project_bundle = path_to_bundle(project) + project.repository.remove rescue nil restore_repo_success = nil + if File.exist?(path_to_project_bundle) begin project.repository.create_from_bundle(path_to_project_bundle) |