Updated

app/jobs / archive_petitions_job.rb

A
14 lines of codes
1 methods
8.2 complexity/method
3 churn
8.23 complexity
0 duplications
class ArchivePetitionsJob < ApplicationJob
  1. ArchivePetitionsJob has no descriptive comment
queue_as :high_priority def perform
  1. ArchivePetitionsJob#perform doesn't depend on instance state (maybe move it to another class?)
Appsignal.without_instrumentation do Petition.find_each do |petition| next if petition.archived? ArchivePetitionJob.perform_later(petition) petition.update_column(:archiving_started_at, Time.current) end end end end