raiseError,s_('UpdateRepositoryStorage|Timeout waiting for %{type} repository pushes')%{type:type.name}
end
repository=type.repository_for(project)
full_path=repository.full_path
raw_repository=repository.raw
checksum=repository.checksum
# Initialize a git repository on the target path
new_repository=Gitlab::Git::Repository.new(
new_storage_key,
raw_repository.relative_path,
raw_repository.gl_repository,
full_path
)
new_repository.create_repository
new_repository.replicate(raw_repository)
new_checksum=new_repository.checksum
ifchecksum!=new_checksum
raiseError,s_('UpdateRepositoryStorage|Failed to verify %{type} repository checksum from %{old} to %{new}')%{type:type.name,old:checksum,new:new_checksum}
end
end
defmark_old_paths_for_archive
old_repository_storage=project.repository_storage
new_project_path=moved_path(project.disk_path)
# Notice that the block passed to `run_after_commit` will run with `project`
# as its context
project.run_after_commitdo
GitlabShellWorker.perform_async(:mv_repository,
old_repository_storage,
disk_path,
new_project_path)
ifwiki.repository_exists?
GitlabShellWorker.perform_async(:mv_repository,
old_repository_storage,
wiki.disk_path,
"#{new_project_path}.wiki")
end
end
end
defmoved_path(path)
"#{path}+#{project.id}+moved+#{Time.now.to_i}"
end
# The underlying FetchInternalRemote call uses a `git fetch` to move data
# to the new repository, which leaves it in a less-well-packed state,
# lacking bitmaps and commit graphs. Housekeeping will boost performance