Class: SolidApm::CleanupJob

Inherits:
ApplicationJob show all
Defined in:
app/jobs/solid_apm/cleanup_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(older_than = '1.month.ago') ⇒ Object



5
6
7
8
9
10
11
# File 'app/jobs/solid_apm/cleanup_job.rb', line 5

def perform(older_than = '1.month.ago')
  result = CleanupService.new(older_than: older_than).call

  Rails.logger.info "SolidApm::CleanupJob completed: deleted #{result[:deleted_count]} transactions older than #{result[:cutoff_time]} (#{result[:older_than]})"

  result
end