Commit 83504469 authored by Michael Kozono's avatar Michael Kozono Committed by Imre Farkas

Remove backward compatibility code

And the corresponding tests.
parent a79cad41
......@@ -19,13 +19,6 @@ module Geo
DELAY_INTERVAL = 10.seconds.to_i # base delay for scheduling batch execution
def perform(operation)
# TODO: This is a temporary workaround for backward compatibility
# to avoid jobs that have been already scheduled to fail.
# See https://gitlab.com/gitlab-org/gitlab/issues/13318
if operation.to_sym == :recheck_repositories
operation = :reverify_repositories
end
return fail_invalid_operation!(operation) unless OPERATIONS.include?(operation.to_sym)
try_obtain_lease do
......
......@@ -15,13 +15,6 @@ module Geo
OPERATIONS = [:resync_repositories, :reverify_repositories].freeze
def perform(operation, range)
# TODO: This is a temporary workaround for backward compatibility
# to avoid jobs that have been already scheduled to fail.
# See https://gitlab.com/gitlab-org/gitlab/issues/13318
if operation.to_sym == :recheck_repositories
operation = :reverify_repositories
end
case operation.to_sym
when :resync_repositories
resync_repositories(range)
......
......@@ -16,17 +16,6 @@ RSpec.describe Geo::Batch::ProjectRegistrySchedulerWorker do
end
describe '#perform' do
context 'when operation is :recheck_repositories' do
let!(:registry) { create(:geo_project_registry, :repository_verified) }
it 'schedules batches of repositories for reverify' do
Sidekiq::Testing.fake! do
expect { subject.perform(:recheck_repositories) }.to change(Geo::Batch::ProjectRegistryWorker.jobs, :size).by(1)
expect(Geo::Batch::ProjectRegistryWorker.jobs.last['args']).to include('reverify_repositories')
end
end
end
context 'when operation is :reverify_repositories' do
let!(:registry) { create(:geo_project_registry, :repository_verified) }
......
......@@ -14,18 +14,6 @@ RSpec.describe Geo::Batch::ProjectRegistryWorker do
describe '#perform' do
let(:range) { [0, registry.id] }
context 'when operation is :recheck_repositories' do
let!(:registry) { create(:geo_project_registry, :repository_verified) }
it 'flags repositories for reverify' do
Sidekiq::Testing.inline! do
subject.perform(:recheck_repositories, range)
end
expect(registry.reload.repository_verification_pending?).to be_truthy
end
end
context 'when operation is :reverify_repositories' do
let!(:registry) { create(:geo_project_registry, :repository_verified) }
......
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