Module: Chewy::Index::Import
- Extended by:
- ActiveSupport::Concern
- Included in:
- Chewy::Index
- Defined in:
- lib/chewy/index/import.rb,
lib/chewy/index/import/routine.rb,
lib/chewy/index/import/progressbar.rb,
lib/chewy/index/import/bulk_builder.rb,
lib/chewy/index/import/bulk_request.rb,
lib/chewy/index/import/journal_builder.rb
Defined Under Namespace
Modules: ClassMethods Classes: BulkBuilder, BulkRequest, JournalBuilder, Progressbar, Routine
Constant Summary collapse
- IMPORT_WORKER =
lambda do |index, , total, ids, iteration| ::Process.setproctitle("chewy [#{index}]: import data (#{iteration + 1}/#{total})") routine = Routine.new(index, **) processed = 0 index.adapter.import(*ids, routine.) do |action_objects| routine.process(**action_objects) processed += action_objects.sum { |_, v| v.size } end {errors: routine.errors, import: routine.stats, leftovers: routine.leftovers, processed: processed} end
- LEFTOVERS_WORKER =
lambda do |index, , total, body, iteration| ::Process.setproctitle("chewy [#{index}]: import leftovers (#{iteration + 1}/#{total})") routine = Routine.new(index, **) routine.perform_bulk(body) {errors: routine.errors} end