Class: AtlasEngine::AddressImporter::ResumableImportJob

Inherits:
AtlasEngine::ApplicationJob show all
Includes:
ImportLogHelper, Concerns::AddressImporter::HandlesErrors, JobIteration::Iteration
Defined in:
app/jobs/atlas_engine/address_importer/resumable_import_job.rb

Constant Summary

Constants included from ImportLogHelper

ImportLogHelper::TEST_TIMESTAMP

Instance Method Summary collapse

Methods included from ImportLogHelper

#import_log_error, #import_log_info

Methods included from LogHelper

#log_error, #log_info, #log_warn

Methods inherited from AtlasEngine::ApplicationJob

#argument

Instance Method Details

#country_importObject



43
44
45
46
# File 'app/jobs/atlas_engine/address_importer/resumable_import_job.rb', line 43

def country_import
  country_import_id = argument(:country_import_id)
  CountryImport.find(country_import_id) if country_import_id.present?
end

#log_final_statsObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'app/jobs/atlas_engine/address_importer/resumable_import_job.rb', line 23

def log_final_stats
  message = if country_import.detected_invalid_addresses?
    "Invalid addresses detected"
  else
    "No invalid addresses detected"
  end

  import_log_info(
    country_import: country_import,
    message: message,
    notify: true,
  )

  import_log_info(
    country_import: country_import,
    message: "Import complete!",
    notify: true,
  )
end