Sha256: 8c24cbc25296d4807de30fd724c29fc1308365890bb6c53977d0d553e41e2ebf

Contents?: true

Size: 803 Bytes

Versions: 11

Compression:

Stored size: 803 Bytes

Contents

# frozen_string_literal: true

namespace :bulkrax do
  desc "Remove old exported zips and create new ones with the new file structure"
  task rerun_all_exporters: :environment do
    # delete the existing folders and zip files
    Dir["tmp/exports/**"].each { |file| FileUtils.rm_rf(file) }

    if defined?(::Hyku)
      Account.find_each do |account|
        next if account.name == "search"
        switch!(account)
        puts "=============== updating #{account.name} ============"

        make_new_exports

        puts "=============== finished updating #{account.name} ============"
      end
    else
      make_new_exports
    end
  end

  def make_new_exports
    Bulkrax::Exporter.all.each { |e| Bulkrax::ExporterJob.perform_later(e.id) }
  rescue => e
    puts "(#{e.message})"
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
bulkrax-5.3.1 lib/tasks/bulkrax_tasks.rake
bulkrax-5.3.0 lib/tasks/bulkrax_tasks.rake
bulkrax-5.2.1 lib/tasks/bulkrax_tasks.rake
bulkrax-4.4.2 lib/tasks/bulkrax_tasks.rake
bulkrax-5.2.0 lib/tasks/bulkrax_tasks.rake
bulkrax-4.4.1 lib/tasks/bulkrax_tasks.rake
bulkrax-4.3.1 lib/tasks/bulkrax_tasks.rake
bulkrax-5.1.0 lib/tasks/bulkrax_tasks.rake
bulkrax-5.0.0 lib/tasks/bulkrax_tasks.rake
bulkrax-4.4.0 lib/tasks/bulkrax_tasks.rake
bulkrax-4.3.0 lib/tasks/bulkrax_tasks.rake