Move GeoRenameRepositoryWorker under Geo namespace

parent f93a82af
......@@ -9,7 +9,7 @@ module Geo
end
def async_execute
GeoRenameRepositoryWorker.perform_async(project_id, old_disk_path, new_disk_path)
Geo::RenameRepositoryWorker.perform_async(project_id, old_disk_path, new_disk_path)
end
def execute
......
module Geo
class RenameRepositoryWorker
include Sidekiq::Worker
include GeoQueue
def perform(project_id, old_disk_path, new_disk_path)
Geo::RenameRepositoryService.new(project_id, old_disk_path, new_disk_path).execute
end
end
end
class GeoRenameRepositoryWorker
include Sidekiq::Worker
include GeoQueue
def perform(project_id, old_path_with_namespace, new_path_with_namespace)
Geo::RenameRepositoryService.new(project_id, old_path_with_namespace, new_path_with_namespace).execute
end
end
......@@ -204,12 +204,12 @@ describe Gitlab::Geo::LogCursor::Daemon, :postgresql do
expect { daemon.run_once! }.not_to change(Geo::ProjectRegistry, :count)
end
it 'schedules a GeoRenameRepositoryWorker' do
it 'schedules a Geo::RenameRepositoryWorker' do
project_id = repository_renamed_event.project_id
old_path_with_namespace = repository_renamed_event.old_path_with_namespace
new_path_with_namespace = repository_renamed_event.new_path_with_namespace
expect(::GeoRenameRepositoryWorker).to receive(:perform_async)
expect(::Geo::RenameRepositoryWorker).to receive(:perform_async)
.with(project_id, old_path_with_namespace, new_path_with_namespace)
daemon.run_once!
......
......@@ -27,13 +27,13 @@ describe Geo::RenameRepositoryService do
subject(:service) { described_class.new(project.id, project.full_path, new_path) }
it 'starts the worker' do
expect(GeoRenameRepositoryWorker).to receive(:perform_async)
expect(Geo::RenameRepositoryWorker).to receive(:perform_async)
service.async_execute
end
it 'returns job id' do
allow(GeoRenameRepositoryWorker).to receive(:perform_async).and_return('foo')
allow(Geo::RenameRepositoryWorker).to receive(:perform_async).and_return('foo')
expect(service.async_execute).to eq('foo')
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