class ElasticArSync::Elastic::Worker::IndexImportWorker

Public Instance Methods

perform(klass, target_index, batch_size) click to toggle source
# File lib/elastic_ar_sync/elastic/worker/index_import_worker.rb, line 5
def perform(klass, target_index, batch_size)
  Rails.logger.debug "[elastic IndexImportWorker] start import #{target_index}"

  begin
    ElasticArSync::Elastic::Services::IndexHandler.new(Object.const_get(klass)).import_all_record(target_index, batch_size)
  rescue => e
    Rails.logger.debug "[elastic IndexImportWorker] error occur #{target_index} \n #{e.message}"
  end

  Rails.logger.debug "[elastic IndexImportWorker] finish import #{target_index}"
end