Commit 80197bdc authored by Ahmad Hassan's avatar Ahmad Hassan

Remove gitaly_migrate blocks and replace by early return

parent 125be186
...@@ -67,13 +67,12 @@ module Backup ...@@ -67,13 +67,12 @@ module Backup
end end
def prepare_directories def prepare_directories
# TODO: Need to find a way to do this for gitaly
# Gitaly discussion issue: https://gitlab.com/gitlab-org/gitaly/issues/1194
return if Gitlab::GitalyClient.feature_enabled?(:backup_skip_prepare_directories) return if Gitlab::GitalyClient.feature_enabled?(:backup_skip_prepare_directories)
Gitlab.config.repositories.storages.each do |name, repository_storage| Gitlab.config.repositories.storages.each do |name, repository_storage|
gitaly_migrate(:remove_repositories) do |is_enabled|
# TODO: Need to find a way to do this for gitaly
# Gitaly discussion issue: https://gitlab.com/gitlab-org/gitaly/issues/1194
unless is_enabled
path = repository_storage.legacy_disk_path path = repository_storage.legacy_disk_path
next unless File.exist?(path) next unless File.exist?(path)
...@@ -92,14 +91,10 @@ module Backup ...@@ -92,14 +91,10 @@ module Backup
end end
end end
end end
end
end
def restore_custom_hooks def restore_custom_hooks
gitaly_migrate(:restore_custom_hooks) do |is_enabled|
# TODO: Need to find a way to do this for gitaly # TODO: Need to find a way to do this for gitaly
# Gitaly migration issue: https://gitlab.com/gitlab-org/gitaly/issues/1195 # Gitaly migration issue: https://gitlab.com/gitlab-org/gitaly/issues/1195
unless is_enabled
in_path(path_to_tars(project)) do |dir| in_path(path_to_tars(project)) do |dir|
path_to_project_repo = path_to_repo(project) path_to_project_repo = path_to_repo(project)
cmd = %W(tar -xf #{path_to_tars(project, dir)} -C #{path_to_project_repo} #{dir}) cmd = %W(tar -xf #{path_to_tars(project, dir)} -C #{path_to_project_repo} #{dir})
...@@ -110,8 +105,6 @@ module Backup ...@@ -110,8 +105,6 @@ module Backup
end end
end end
end end
end
end
def restore def restore
prepare_directories prepare_directories
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment