Class: AmalyticsImportWorker
- Inherits:
-
Object
- Object
- AmalyticsImportWorker
- Includes:
- Sidekiq::Job, Workers::StatusBroadcastable
- Defined in:
- app/workers/amalytics_import_worker.rb
Overview
Sidekiq worker: amalytics import.
Instance Attribute Summary
Attributes included from Workers::StatusBroadcastable
Instance Method Summary collapse
Methods included from Workers::StatusBroadcastable::Overrides
Instance Method Details
#perform(options = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/workers/amalytics_import_worker.rb', line 7 def perform( = {}) = .symbolize_keys upload_id = [:upload_id] force = [:force].to_b redirect_to = [:redirect_to] upload = Upload.find(upload_id) file_path = upload.to_file importer = Amazon::ImportAmalyticsSnapshot.new(worker: self) res = importer.process(file_path:, force:) = "Job Complete, #{res.items_result.size} rows processed" store redirect_to: redirect_to, info_message: end |