Fix Geo::RepositoriesCleanUpWorker to work with hashed storage

parent 06215a1d
......@@ -30,12 +30,12 @@ module Geo
# There is a possibility project does not have repository or wiki
return true unless gitlab_shell.exists?(project.repository_storage_path, "#{project.disk_path}.git")
job_id = ::GeoRepositoryDestroyWorker.perform_async(project.id, project.name, project.full_path)
job_id = ::GeoRepositoryDestroyWorker.perform_async(project.id, project.name, project.disk_path, project.repository.storage)
if job_id
log_info('Repository cleaned up', project_id: project.id, full_path: project.full_path, job_id: job_id)
log_info('Repository cleaned up', project_id: project.id, disk_path: project.disk_path, job_id: job_id)
else
log_error('Could not clean up repository', project_id: project.id, full_path: project.full_path)
log_error('Could not clean up repository', project_id: project.id, disk_path: project.disk_path)
end
end
......
......@@ -17,11 +17,11 @@ describe Geo::RepositoriesCleanUpWorker do
unsynced_project = create(:project, :repository)
expect(GeoRepositoryDestroyWorker).to receive(:perform_async)
.with(unsynced_project.id, unsynced_project.name, unsynced_project.full_path)
.with(unsynced_project.id, unsynced_project.name, unsynced_project.disk_path, unsynced_project.repository.storage)
.once.and_return(1)
expect(GeoRepositoryDestroyWorker).not_to receive(:perform_async)
.with(project_in_synced_group.id, project_in_synced_group.name, project_in_synced_group.full_path)
.with(project_in_synced_group.id, project_in_synced_group.name, project_in_synced_group.disk_path, project_in_synced_group.repository.storage)
subject.perform(geo_node.id)
end
......
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