Class: Coil::TransactionalMessagesPeriodicJob
Instance Method Summary
collapse
Instance Method Details
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'app/jobs/coil/transactional_messages_periodic_job.rb', line 8
def perform
t = Time.current - TransactionalMessagesJob::MAX_DURATION
message_parent_class.select(:type).distinct.each do |x|
message_class = x.class
job_class = x.job_class
message_class
.unprocessed(processor_name: job_class.name)
.where(created_at: nil...t)
.distinct
.pluck(:key)
.each { |k| job_class.perform_async(k) }
end
end
|