Browse Source

feat: update batch import task

full-import-optimisation
natdeanlewissoftwire 1 year ago
parent
commit
b145754da2
  1. 3
      lib/tasks/full_import.rake

3
lib/tasks/full_import.rake

@ -89,11 +89,10 @@ namespace :import do
desc "Batch import logs"
task :batch_import_logs, %i[institutions_csv_name orgs_per_batch batch_number] => :environment do |_task, args|
institutions_csv_name = args[:institutions_csv_name]
app_name = args[:app_name]
orgs_per_batch = args[:orgs_per_batch]
batch_number = args[:batch_number]
raise "Usage: rake import:batch_import_logs['institutions_csv_name', 'app_name', 'orgs_per_batch', 'batch_number']" if [institutions_csv_name, app_name, orgs_per_batch, batch_number].any?(&:blank?)
raise "Usage: rake import:batch_import_logs['institutions_csv_name', 'orgs_per_batch', 'batch_number']" if [institutions_csv_name, app_name, orgs_per_batch, batch_number].any?(&:blank?)
s3_service = Storage::S3Service.new(PlatformHelper.is_paas? ? Configuration::PaasConfigurationService.new : Configuration::EnvConfigurationService.new, ENV["IMPORT_PAAS_INSTANCE"])
whole_csv = CSV.parse(s3_service.get_file_io(institutions_csv_name), headers: true)

Loading…
Cancel
Save