Move GeoRenameRepositoryWorker under Geo namespace

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