|
1class PetitionCountJob < ApplicationJob
|
|
2 delegate :signature_count_interval, to: :Site
|
|
3 delegate :disable_invalid_signature_count_check?, to: :Site
|
|
|
|
5 queue_as :highest_priority
|
|
|
|
7 def perform(now = current_time)
|
|
8 return if disable_invalid_signature_count_check?
|
|
|
|
10 petitions.find_each do |petition|
|
|
11 unless petition.valid_signature_count!
|
|
12 ResetPetitionSignatureCountJob.perform_later(petition, now)
|
|
|
|
|
|
|
|
|
|
|
|
|
- UtilityFunction - doesn't depend on instance state (maybe move it to another class?) » reek
- Complexity 1 » saikuro
|
|
|
20 Time.current.change(usec: 0).iso8601
|
|
|
|
|
- UtilityFunction - doesn't depend on instance state (maybe move it to another class?) » reek
- Complexity 1 » saikuro
|
|
|
24 Petition.in_need_of_validating
|
|
|
|
|