diff --git a/app/services/migration/migrators/contract.rb b/app/services/migration/migrators/contract.rb index a07719c20c..9eb0cb5534 100644 --- a/app/services/migration/migrators/contract.rb +++ b/app/services/migration/migrators/contract.rb @@ -1,5 +1,7 @@ module Migration::Migrators class Contract < Base + INFRA_WORKER_COUNT = 1 + SHARED_ATTRIBUTES = %w[ created_at updated_at @@ -30,6 +32,18 @@ def ecf_contracts def dependencies %i[course statement] end + + def number_of_workers + return 1 if record_count > 1000 + + super + end + + def records_per_worker + return record_count if record_count > 1000 + + super + end end def call diff --git a/spec/services/migration/migrators/contract_spec.rb b/spec/services/migration/migrators/contract_spec.rb index 766c6eddf9..7312b26fc8 100644 --- a/spec/services/migration/migrators/contract_spec.rb +++ b/spec/services/migration/migrators/contract_spec.rb @@ -2,6 +2,8 @@ RSpec.describe Migration::Migrators::Contract do it_behaves_like "a migrator", :contract, %i[course statement] do + let(:records_per_worker_divider) { 2 } + def create_ecf_resource cohort = create(:ecf_migration_cohort) npq_lead_provider = create(:ecf_migration_npq_lead_provider)