Class: ReferenceEventsProcessorJob
- Inherits:
-
ApplicationJob
- Object
- ActiveJob::Base
- ApplicationJob
- ReferenceEventsProcessorJob
- Defined in:
- app/jobs/reference_events_processor_job.rb
Instance Method Summary collapse
Instance Method Details
#perform ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/jobs/reference_events_processor_job.rb', line 4 def perform ReferenceEvent.where( end_at: nil, slug: ReferenceEvent::PROCESSABLE_EVENTS ).find_each do |reference_event| reference_event.process reference_event.update!(end_at: Time.current) ReferenceEvent.create!( level: ReferenceEvent::Levels::INFO, slug: ReferenceEvent::Slugs::SUCCESSFULLY_PROCESSED, reference: reference_event ) end end |