1class EnqueuePetitionStatisticsUpdatesJob < ApplicationJob
 
2  queue_as :low_priority
 
3
 
4  delegate :disable_daily_update_statistics_job?, to: :Site
 
5
  • Complexity 3 » saikuro
6  def perform(timestamp)
 
7    return if disable_daily_update_statistics_job?
 
8
 
 9    Petition.signed_since(timestamp.in_time_zone).find_each do |petition|
 
10      UpdatePetitionStatisticsJob.perform_later(petition)
 
11    end
 
12  end
 
13end